Advertisement
Guest User

Untitled

a guest
Nov 25th, 2017
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1.  
  2. $ftp_server = "superqti.com.mx";
  3. $ftp_user = "csfacturacion@superqti.com.mx";
  4. $ftp_pass = "xxxxxxx";
  5.  
  6. // establecer una conexión o finalizarla
  7. $conn_id = ftp_connect($ftp_server) or die("No se pudo conectar a $ftp_server");
  8.  
  9. // intentar iniciar sesión
  10. if (@ftp_login($conn_id, $ftp_user, $ftp_pass))
  11. echo "Conectado como $ftp_user@$ftp_server\n";
  12. else
  13. echo "No se pudo conectar como $ftp_user\n";
  14.  
  15. ftp_pasv($conn_id, true);
  16. ftp_chdir($conn_id, "/");
  17.  
  18. $remote_file = "reporte".date("Y").date("m").date("d").".txt";
  19. if(ftp_put($conn_id, $remote_file, $mytemp, FTP_ASCII))
  20. echo "se ha cargado $remote_file con éxito\n";
  21. else
  22. echo "Hubo un problema durante la transferencia de $remote_file\n";
  23.  
  24. // cerrar la conexión ftp
  25. ftp_close($conn_id);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement