Jump to content

FTP_PUT/FTP_FPUT - File shows up on FTP server, but won't open & size = 0


bigdspbandj

Recommended Posts

Hey all. I am trying to copy a file from my webserver to a remote server via FTP. It's a zip file that works fine (when I download directly from the web server). The file shows up in the correct location on the remote server, but the file size is 0 and it can't be opened.

 

I get the following error:

Warning: ftp_fput() [function.ftp-fput]: Type set to I.

 

Here is the code:

	function uploadFiles($ftp_info, $file_path, $file)
{		
	$zip_file = fopen($file_path.$file, 'r');

	$ftp_connection = ftp_ssl_connect($ftp_info['host']);
	$login_result = ftp_login($ftp_connection, $ftp_info['username'], $ftp_info['password']);

	$ftp_pasv = ftp_pasv($ftp_connection, true);

	$upload = ftp_fput($ftp_connection, '/Walz/ToWalz/'.$file, $zip_file, FTP_BINARY);

	ftp_close($ftp_connection);
	fclose($zip_file);

	return $upload;
}

 

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.