ID: 40574 Comment by: lc at nospam dot com Reported By: [EMAIL PROTECTED] Status: No Feedback Bug Type: Streams related PHP Version: 5.2.1 New Comment:
I am also getting the same behavior mat describes using 5.2.2 The only way to get a successfull upload using file_put_contents using a ftp stream is when the file being uploaded does not exist on the server. Subsequent uploads with the stream_context of overwrite being true result in a zero-byte file Previous Comments: ------------------------------------------------------------------------ [2007-03-28 14:34:44] mat at actiondb dot com The example: <?php $c = stream_context_create(array("ftp" => array("overwrite"=>true))); var_dump(file_put_contents("ftp://localhost/upload/data.txt", "data", 0, $c)); ?> Will output int(4), but if you check the FTP server, the file will probably be 0 bytes. I have been trying to resolve this problem myself, and it seems that if the file is greater than around 30K-35K (maybe it's 32K?), the upload works. I'm using PHP 5.2.1 on Apache 2.2.4 installed on Win2k3 ------------------------------------------------------------------------ [2007-03-14 01:00:00] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2007-03-06 11:55:08] [EMAIL PROTECTED] Can't reproduce using vsftpd. ------------------------------------------------------------------------ [2007-03-05 13:48:52] [EMAIL PROTECTED] Using proftpd with authentication fails php > $c = stream_context_create(array("ftp" => array("overwrite"=>true))); php > var_dump(file_put_contents("ftp://xx:[EMAIL PROTECTED]/data.txt", "data", 0, $c)); Warning: file_put_contents(): Only 0 of 4 bytes written, possibly out of free disk space in php shell code on line 1 ------------------------------------------------------------------------ [2007-03-01 01:00:00] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/40574 -- Edit this bug report at http://bugs.php.net/?id=40574&edit=1