#30516 [Opn->Fbk]: file_put_contents doesnt work with FTP
| From: | sniper@php.net | Date: | Mon, 07 Mar 2005 21:23:17 +0000 |
| Subject: | #30516 [Opn->Fbk]: file_put_contents doesnt work with FTP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-75077@lists.php.net to get a copy of this message | ||
ID: 30516
Updated by: sniper@php.net
Reported By: nlopess@php.net
-Status: Open
+Status: Feedback
Bug Type: FTP related
Operating System: linux
PHP Version: 5CVS-2004-10-21 (dev)
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
..and again, update the version field accordinly.
Previous Comments:
------------------------------------------------------------------------
[2004-10-21 19:17:21] nlopess@php.net
Description:
------------
file_put_contents isn't working with FTP (or I'm doing
something wrong).
Tested in PHP 5.0.3-dev
Reproduce code:
---------------
<?php
$context = stream_context_create(array('ftp' => array('overwrite' =>
true)));
if(file_put_contents("ftp://anonymous:anonymous@10.1.1.54/MS/OPEN-R/MW/OBJS/SOCROB4L.BIN",
file_get_contents('src/SocRob4l.bin'), null, $context) === false) {
echo "There was an error";
} else {
echo "The upload completed succesfully";
}
?>
Expected result:
----------------
The upload completed succesfully
Actual result:
--------------
Warning:
file_put_contents(ftp://...@10.1.1.54/MS/OPEN-R/MW/OBJS/SOCROB4L.BIN):
failed to open stream: Operation now in progress
in /home/socrob4l/consola/update4.php on line 5
There was an error
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30516&edit=1