#27220 [Opn->Fbk]: downloading larger file which is passed via readfile using ftp:// wrapper fails

From: Date: Fri, 13 Feb 2004 15:07:24 +0000
Subject: #27220 [Opn->Fbk]: downloading larger file which is passed via readfile using ftp:// wrapper fails
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-54864@lists.php.net to get a copy of this message
ID: 27220 Updated by: sniper@php.net Reported By: jexli at vip dot 163 dot com -Status: Open +Status: Feedback Bug Type: FTP related Operating System: windows xp PHP Version: 5.0.0b3 (beta3) New Comment: 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..) Previous Comments: ------------------------------------------------------------------------ [2004-02-13 05:03:17] 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-11 10:58:39] 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-11 09:26:26] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27220&edit=1

« previous php.bugs (#54864) next »