#40574 [Com]: file_put_contents fails with ftp wrapper
| From: | mat at actiondb dot com | Date: | Wed, 28 Mar 2007 14:34:45 +0000 |
| Subject: | #40574 [Com]: file_put_contents fails with ftp wrapper | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-110887@lists.php.net to get a copy of this message | ||
ID: 40574
Comment by: mat at actiondb dot com
Reported By: arnaud@php.net
Status: No Feedback
Bug Type: Streams related
PHP Version: 5.2.1
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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] tony2001@php.net
Can't reproduce using vsftpd.
------------------------------------------------------------------------
[2007-03-05 13:48:52] arnaud@php.net
Using proftpd with authentication fails
php > $c = stream_context_create(array("ftp" =>
array("overwrite"=>true)));
php > var_dump(file_put_contents("ftp://xx:xx@localhost/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".
------------------------------------------------------------------------
[2007-02-21 13:32:46] tony2001@php.net
<?php
$c = stream_context_create(array("ftp" => array("overwrite"=>true)));
var_dump(file_put_contents("ftp://localhost/upload/data.txt",
"data",
0, $c));
?>
outputs:
int(4)
Check your FTP server?
------------------------------------------------------------------------
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