Re: Timeout while waiting for a server->client transfer to start (large files)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux