Jump to content

Copying zip over FTP


ElFenix

Recommended Posts

I am trying to have my site copy a zip file from an ftp site to the server, but whenever it gets to the server it is always corrupted.  Has anyone else come across this?  How could I fix it?

$local_file = 'local.zip';
$remote_file = 'remote.zip';
$handle = fopen($local_file, 'w+');
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
ftp_fget($conn_id, $handle, $remote_file, FTP_ASCII, 0);
ftp_close($conn_id);
fclose($handle);

Link to comment
https://forums.phpfreaks.com/topic/86700-copying-zip-over-ftp/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.