Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

ftp is uploading file but 0kb file size or data

If when using ftp_put you get the one of the following errors:

Warning: ftp_put() [function.ftp-put]: Opening ASCII mode data connection

Warning: ftp_put() [function.ftp-put]: Opening BINARY mode data connection

and it creates the file in the correct location but is a 0kb file and all FTP commands thereafter fail. It is likely that the client is behind a firewall. To rectify this use:

<?php
ftp_pasv($resource, true);
?>

Before executing any put commands. Took me so long to figure this out I actually cheered when I did :D
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #ftp #uploading #file #file #size #data
ADD COMMENT
Topic
Name
6+7 =