title: How to upload images to ftp server?
body: <p>I'm using database to store my image files. As it's pretty slow I wanted to save them onto ftp server. </p>
  
  <p>I tried <code>move__uploaded_file()</code> but it seems to nor work for me (it does not show any error, but file is not saved nor moved).</p>
  
  <pre><code>$name = $_FILES['image']['name'];
  $temp = $_FILES['image']['tmp_name'];
  $type = $_FILES['image']['type'];
  $size = $_FILES['image']['size'];
  $location = "/images/images_doprava/";
  
  if($size &lt;= 2621440) {
      if(!move_uploaded_file($temp,$location.$name)) { 
          echo "Error!"; 
      }
      header( 'Location: ../edit.php' );
  } else {
      echo "Image has size bigger than 2,5 MB";
  }
  </code></pre>
  
  <p>So, how can I upload the files onto ftp server and get the name of saved file? Thank you.</p>