Thanks, this suggestion from Dante completely solved the problem.


readfile('/var/www/mypath/My Cool Image.dmg');


$fd = fopen ('/var/www/mypath/My Cool Image.dmg', "r");
while(!feof($fd)) {
    echo fread($fd, 4096);
fclose ($fd);

It's now serving all files properly. 

On Apr 25, 2012, at 9:07 PM, D. Dante Lorenso wrote:

> You'll want to use fopen, fread, fwrite, and fclose to loop through bytes in 
> your file as you shuttle chunks to the client instead of slooping it all into 
> memory in one hunk.

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to