|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41643 ftp_size() does not return work on large files
Submitted: 2007-06-09 18:48 UTC Modified: 2020-03-10 09:11 UTC
Avg. Score:4.0 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: mweber at netprovide dot com Assigned:
Status: Suspended Package: FTP related
PHP Version: 5.2.3 OS: SuSE Linux 10
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: mweber at netprovide dot com
New email:
PHP Version: OS:


 [2007-06-09 18:48 UTC] mweber at netprovide dot com
ftp_size() does not work on files lager than 2GB...

I know, that PHP is limited to handle just 32bit integer values...

My Idea would be, that you alter this function to:

float ftp_size ( resource $ftp_stream, string $remote_file [, int $unit='B'])

where $unit can be:

you just need to change the return value to float and calculate the internal "string"(size) to the value requested...

this would produce smaller numbers...

Reproduce code:

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-09 18:53 UTC] mweber2 at netprovide dot com
well it should be a string instead of int for the additional argument

float ftp_size ( resource $ftp_stream, string $remote_file [, string
 [2011-02-21 21:03 UTC]
-Package: Feature/Change Request +Package: FTP related
 [2020-03-10 09:11 UTC]
-Status: Open +Status: Suspended
 [2020-03-10 09:11 UTC]
> I know, that PHP is limited to handle just 32bit integer
> values...

Besides that, as of PHP 7.0.0, this limitation no longer applies
to any of the supported 64bit architectures, I don't think that
special casing ftp_size() (but not related functions like
filesize()) makes any sense.  In any way, that would need
discussion on the internals mailing list[1].  Feel free to write
to the list; for the time being I'm suspending this ticket.

[1] <>
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 28 18:04:14 2021 UTC