|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-05-06 19:00 UTC] flobee at gmail dot com
Description:
------------
when file lager than ~ 2MB i only get ~2MB send to the header
eg:
if($result_size = @readfile( $file_to_download) ) { ;
$msg = _DOWNLOAD_SUCCESSFUL;
} else {
$msg = _ERROR_COULDNOTCOMPLETETHEFILE;
}
this is since php5 beta and have no idea why, no error no other messages.
execution time and memorylimit are set very high for testing. no changes.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 05:00:01 2025 UTC |
hmmm. my hoster still has this bug, i just reported this as "note" for other users to have a work around. <?php function readfile_chunked($filename,$retbytes=true) { $chunksize = 1*(1024*1024); // how many bytes per chunk $buffer = ''; $cnt =0; // $handle = fopen($filename, 'rb'); $handle = fopen($filename, 'rb'); if ($handle === false) { return false; } while (!feof($handle)) { $buffer = fread($handle, $chunksize); echo $buffer; if ($retbytes) { $cnt += strlen($buffer); } } $status = fclose($handle); if ($retbytes && $status) { return $cnt; // return num. bytes delivered like readfile() does. } return $status; } ?> kind regards flobee