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;
}

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.