Re: Downloading Large (100M+) Files
| From: | Robin Getz | Date: | Thu, 04 Nov 2004 23:09:25 +0000 |
| Subject: | Re: Downloading Large (100M+) Files | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-201235@lists.php.net to get a copy of this message | ||
OK, I checked things out, and based on some private emails, and pointers, from Francisco M. Marzoa [fmmarzoa@gmx.net], I have now
replaced:
readfile($name);
with:
while(!feof($fp)) {
$buf = fread($fp, 4096);
echo $buf;
$bytesSent+=strlen($buf); /* We know how many bytes were sent to the user */
}
I restarted apache (to free all the memory), and we will see how it goes overnight.
-Robin
BTW - output buffering is turned OFF. ob_get_level() returns 0, but both functions readfile and fpassthru seem to allocate memory (and never release) the size of the file.