Afficher un message
Vieux 31/01/2008, 08h13   #4
Per Jessen
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Timeout while waiting for a server->client transfer to start (large files)

Richard Lynch wrote:

> Your script is reading the whole file, 64 measly bytes at a time, into
> a monstrous string $tmp.
>
> Then, finally, when you've loaded the whole [bleep] file into RAM in
> $tmp, you just echo it out, right?
>
> Don't do that.
>
> :-)
>
> while (!feof($fp)){
> echo fread($fp, 2048);
> }



And if the OP is opening the file anyway, he might as well use
readfile() instead.


/Per Jessen, Zürich
  Réponse avec citation
 
Page generated in 0,06539 seconds with 9 queries