Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. $ftphost = "ftp.destino.com";
  2. $ftpuser = "usuario-ftp";
  3. $ftppass = "pass-ftp";
  4.  
  5. $conexion = ftp_connect($ftphost);
  6. $ftplogin = ftp_login($conexion, $ftpuser, $ftppass) or die ("Error FTP login");
  7.  
  8. $origen = "/ftp.php"; //esto genera la ruta /home/xxxxx/web/dominio/test/ftp.php
  9. $destino = "/ftp.movido.php"; //comprobado que en destino la ruta actual es la que debe ser
  10.  
  11. if(ftp_put($conexion, $destino, $origen, FTP_BINARY)) echo "OK"; else echo "ERROR. <br>origen: $origen<br>destino: $destino";
  12.  
  13. if(ftp_close($conexion)) echo "<br><br>OK: Conexión FTP cerrada<br>"; else "<br><br>ERROR: No se ha podido cerrar la conexión FTP<br>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement