Re: readfile() question

From: Date: Mon, 25 Jun 2001 06:11:18 +0000
Subject: Re: readfile() question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-55098@lists.php.net to get a copy of this message
> I was wondering what happens if you call the readfile function to output a > large binary file to a client with a slow connection. > Does the script run until the whole file is sent to the client (leading to > timeout errors on servers with a low max execution time) or does it fill > some sort of buffer on the web server which then takes over and sends the > file to the client? Yes. :-) Odds are pretty good that you can count on network activity to screw this up sooner or later, no matter how big that buffer might be. Add some code to guesstimate how long it ought to take, double it and add 30 (metric time)* and use the time_limit function. Or use 0 time limit, and pray you never mess up the code that spews all that to the browser. In any situation like this, the time to add a little code to anticipate a problem is almost always a "win". * If you don't understand why double it and add 30 is metric time, you need to buy Bob&Doug's _Great_White_North album. -- WARNING richard@zend.com address is an endangered species -- Use ceo@l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#55098) next »