php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27220 downloading larger file which is passed via readfile using ftp:// wrapper fails
Submitted: 2004-02-11 09:26 UTC Modified: 2004-02-17 17:27 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jexli at vip dot 163 dot com Assigned:
Status: No Feedback Package: FTP related
PHP Version: 5.0.0b3 (beta3) OS: windows xp
Private report: No CVE-ID: None
 [2004-02-11 09:26 UTC] jexli at vip dot 163 dot com
Description:
------------
I use readfile() function to force download ftp file.In PHP4.3.4 version,the file size display unknow.But in PHP 5.0 the it works correctly.But they are also occur error when the FTP file size is large to 40M~50M.

Reproduce code:
---------------
<?php 
$filename = $_COOKIE["url"];//ftp request
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=".basename($filename).";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename));
@readfile("$filename"); 
exit();
?> 

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

      USE IN FORCE DOWNLOAD FTP FILE

 PHP 4.0 :If file size > 40M~50M,connection auto reset and download dialog closed.

 PHP 5.0 :If file size > 40M~50M,server cant response the request,download stoped,but download dialog still open,only not any response.

 But if file size <40M~50M,they are works fine.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-11 10:58 UTC] sniper@php.net
Please give proper example script which can be just copy'n'pasted. (and this works just fine for me on linux..tested using 500M file)

 [2004-02-13 05:03 UTC] jexli at vip dot 163 dot com
Find a very serious problem about readfile().

   I use the readfile function to output ftp file(300M) from Ftp Server to my disk,But only one user can download it.other's can't.Not only this,It expend a great deal of server's memory.

Secont question is ftp_get function can only get file to server,can it get for end user's browser?
 [2004-02-13 10:07 UTC] sniper@php.net
Can you please give the feedback I requested first?
And also this 'other' problem (propably related to this),
you NEED TO COME UP WITH EXAMPLE SCRIPT!!!! We can NOT read people's minds..unfortunately. (I simply don't understand what you're writing, code is usually self-explaining..)

 [2004-02-17 17:27 UTC] sniper@php.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 "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 16:01:28 2024 UTC