Re: Serving a .dmg via readfile?
| From: | Matijn Woudt | Date: | Fri, 27 Apr 2012 11:20:02 +0000 |
| Subject: | Re: Serving a .dmg via readfile? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-317713@lists.php.net to get a copy of this message | ||
On Thu, Apr 26, 2012 at 8:20 PM, Brian Dunning <brian@briandunning.com> wrote:
> Thanks, this suggestion from Dante completely solved the problem.
>
> Replaced:
>
> readfile('/var/www/mypath/My Cool Image.dmg');
>
> With:
>
> $fd = fopen ('/var/www/mypath/My Cool Image.dmg', "r");
> while(!feof($fd)) {
> set_time_limit(30);
> echo fread($fd, 4096);
> flush();
> }
> fclose ($fd);
>
> It's now serving all files properly.
>
It is indeed a better solution, but as always, you should've checked
the apache logs first and you would've noticed an PHP error probably
about not enough memory..