title: ftp_put(): Can't open that file: No such file or directory
body: <p>I search a lot on internet but i don't find a solution.
  I need upload a file to an FTP server through PHP.</p>
  <p>I  tested various script PHP like this below but I always receive the same problem (I tries with absolute, normal and other path):</p>
  <blockquote>
  <p>connected<br />
  Warning: ftp_put(): Can't open that file: No such file or directory in /web/htdocs/www.stanem.it/home/csv/importinnovacsv.php on line 20<br />
  There was a problem while uploading /web/htdocs/www.stanem.it/home/csv/test.csv</p>
  </blockquote>
  <p>What I have to do?</p>
  <pre><code>&lt;?php
  $ftp_server=&quot;ftp.xxxx.it&quot;;
  $ftp_user_name=&quot;user&quot;;
  $ftp_user_pass=&quot;psw&quot;;
  
  // connect and login to FTP server
  
  $ftp_conn       = ftp_connect($ftp_server) or die(&quot;Could not connect to $ftp_server&quot;);
  $login          = ftp_login($ftp_conn, $ftp_user_name, $ftp_user_pass);
  
  if($login) {
     echo 'connected&lt;br&gt;'; 
  
     // Where I need to put file
     $local_file = '/web/htdocs/www.stanem.it/home/csv/test.csv'; 
     // Where I copy the file
     $server_dir = 'ftp://15886:XDBbcFYQUs@ftp.innovaspa.it'; 
  
     // upload a file
     if (ftp_put($ftp_conn, $server_dir, $local_file, FTP_ASCII)) {
         echo &quot;successfully uploaded $local_file\n&quot;;
         exit;
     } else {
         echo &quot;There was a problem while uploading $local_file\n&quot;;
         exit;
     }
  } 
  </code></pre>