title: How to move a file between servers using PHP
body: <p>I need to make a PHP function to move a file between 2 servers... For example, I have Sever1  and Server2, I have a file1.php locate on Server1, I need to execute a PHP function like: server1/execute.php to move file1.php to specific directory on Server2. </p>
  
  <p>I'm using:</p>
  
  <pre><code>&lt;?php
  $filename="file1.php";
  unlink("ftp://USER:PASSWORD@IPADDRESS/httpdocs/DESTINATIONFOLDER/".$filename);
  if(!copy($filename, "ftp://USER:PASSWORD@IPADDRESS/httpdocs/DESTINATIONFOLDER/".$filename))  
  {echo "error";}
  
  ?&gt;    
  </code></pre>
  
  <p>that code work on my local server but when I publish on the server, the file is copied incomplete.</p>
  
  <p>Some idea?</p>