Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ftphost = "ftp.destino.com";
- $ftpuser = "usuario-ftp";
- $ftppass = "pass-ftp";
- $conexion = ftp_connect($ftphost);
- $ftplogin = ftp_login($conexion, $ftpuser, $ftppass) or die ("Error FTP login");
- $origen = "/ftp.php"; //esto genera la ruta /home/xxxxx/web/dominio/test/ftp.php
- $destino = "/ftp.movido.php"; //comprobado que en destino la ruta actual es la que debe ser
- if(ftp_put($conexion, $destino, $origen, FTP_BINARY)) echo "OK"; else echo "ERROR. <br>origen: $origen<br>destino: $destino";
- 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