php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51190 ftp_put() returns false when transfer was successful
Submitted: 2010-03-03 05:47 UTC Modified: 2021-02-28 04:22 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: alexclifford47 at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: FTP related
PHP Version: 5.3.1 OS: Windows Server 2003 R2 32-bit
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-03-03 05:47 UTC] alexclifford47 at gmail dot com
Description:
------------
Hi,

I am getting the following warning message when trying to use ftp_put():
Warning: ftp_put(): Transfer OK

This is causing the function to return false, when in fact the file is 
transferred 
successfully.

I have Googled this warning message but no one else has ever received it. Where 
is 
this warning coming from and why is PHP reporting a "Transfer OK" as a warning?

Destination server is Windows Server 2008 64-bit running FileZilla Server 
(latest version).

Alex

Test script:
---------------
$conn_id = ftp_connect($ftp_server);
ftp_login($conn_id, $ftp_user, $ftp_pass);

if (ftp_put($conn_id, 

Expected result:
----------------
1

Actual result:
--------------
Warning: ftp_put(): Transfer OK
0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-03 15:55 UTC] araje at usimagingnetwork dot com
I'm having the exact same problem..
The upload is successful , however ftp_put returns false...
Any info would be appreciated.
Thanks
Ameya
 [2010-03-04 13:52 UTC] iliaa@php.net
Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=295820
Log: Fixed bug #51190 (ftp_put() returns false when transfer was successful).
 [2010-03-04 13:53 UTC] iliaa@php.net
-Status: Open +Status: Closed
 [2010-03-04 13:53 UTC] iliaa@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2010-03-05 04:11 UTC] alexclifford47 at gmail dot com
I will give this a try when I get a chance. How long until these fixes are into a 
stable release?
Thanks.
 [2010-03-09 06:10 UTC] alexclifford47 at gmail dot com
I notice you added a check for the 200 response in ftp.c. This didn't fix the 
problem for me. But also adding a check for a 221 response did. Is it possible to 
have this added into the codebase too?
 [2016-11-28 17:41 UTC] cmb@php.net
-Status: Closed +Status: Re-Opened
 [2016-11-28 17:41 UTC] cmb@php.net
Re-opening according to user comment.
 [2017-08-17 03:38 UTC] linh232324 at gmail dot com
I have same issue on PHP 7
 [2017-10-20 18:39 UTC] kalle@php.net
-Assigned To: iliaa +Assigned To:
 [2017-10-20 18:39 UTC] kalle@php.net
Unassigning as Ilia is not currently active
 [2018-03-19 16:54 UTC] cmb@php.net
> But also adding a check for a 221 response did.

According to RFC #959 a 221 reply is supposed to only be possible
for a QUIT command[1].

[1] <https://tools.ietf.org/html/rfc959#page-49>
 [2018-03-19 22:58 UTC] mattficken@php.net
Also, can you repro this on PHP 7.1 or 7.2?
 [2018-10-22 19:22 UTC] afterfivebydesign at gmail dot com
Has this bug been fixed in version 7.2?
 [2021-02-17 15:35 UTC] cmb@php.net
-Status: Re-Opened +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-02-17 15:35 UTC] cmb@php.net
I cannot reproduce this issue with PHP-7.4.  Does anybody else
still get this bogus warning with any of the actively supported
PHP versions[1]?

[1] <php.net/supported-versions.php>
 [2021-02-28 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 10:01:30 2024 UTC