|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32945 copy size 0 file with ftp/http wrappers
Submitted: 2005-05-04 17:28 UTC Modified: 2005-09-07 01:00 UTC
From: jxmaster at msn dot com Assigned: pollita (profile)
Status: No Feedback Package: Filesystem function related
PHP Version: 5.0.4, 4.3.11 OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jxmaster at msn dot com
New email:
PHP Version: OS:


 [2005-05-04 17:28 UTC] jxmaster at msn dot com
copy('ftp://username:password@ip/path/filename', 'tmp.dat');
If the file in the ftp server has size 0, the copy statment returned false. However, the file tmp.dat was created with size 0.
copy ('localfile', 'tmp.dat') worked well.

Reproduce code:
copy('ftp://username:password@ip/path/filename', 'tmp.dat');

Expected result:
The file tmp.dat is created in the current directory with file zero and gets a TRUE return.

Actual result:
The file tmp.dat is created in the current directory with file zero, but gets a FALSE return.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-10 15:17 UTC]
Sara, you're most familiar with this.. (this propably happens in PHP 5 too)

 [2005-05-11 23:02 UTC]
The very same situation exists with http wrapper.
The problem is that php_stream_copy_to_stream() returns 0 on error and we can't distinguish zero-length file from error if there is no stat() for current wrapper.
 [2005-08-30 13:10 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-09-07 01:00 UTC] 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".
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jan 23 12:01:24 2021 UTC