note 18224 added to function.fpassthru
| From: | straz at -removethispart-mac dot com | Date: | Tue, 15 Jan 2002 05:22:51 +0000 |
| Subject: | note 18224 added to function.fpassthru | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-24830@lists.php.net to get a copy of this message | ||
I wrote a page which authenticates the user, then calls fpassthru() to download an Acrobat document.
It worked great up to about 1MB, but for larger files, the script was dying in the middle. My ISP
told me they were killing my script because it was a memory hog. I tried readfile() instead, to no
avail.
I replaced the fpassthru() with this workaround. It works great:
while(!feof($fn)) {
$buffer = fread($fn, 4096);
print $buffer;
}
--
http://www.php.net/manual/en/function.fpassthru.php
http://master.php.net/manage/user-notes.php?action=edit+18224
http://master.php.net/manage/user-notes.php?action=delete+18224
http://master.php.net/manage/user-notes.php?action=reject+18224