|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-11 10:58 UTC] sniper@php.net
[2004-02-13 05:03 UTC] jexli at vip dot 163 dot com
[2004-02-13 10:07 UTC] sniper@php.net
[2004-02-17 17:27 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 06:00:01 2025 UTC |
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.