Re: Useful function for file download (i.e. MP3)
| From: | Richard Lynch | Date: | Tue, 21 Nov 2006 18:36:39 +0000 |
| Subject: | Re: Useful function for file download (i.e. MP3) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244976@lists.php.net to get a copy of this message | ||
On Tue, November 21, 2006 8:33 am, Brad Fuller wrote:
> function will only use up 1K of memory no matter how big the file is.
I think it will use 1M...
> function readfile_chunked($filename,$retbytes=true) {
> $chunksize = 1*(1024*1024); // how many bytes per chunk
:-)
The multiple calls to ob_flush() within the body of the loop are
probably not a Good Idea, as a general rule...
flush() is also probably overkill, really, for any file big enough for
this function to be desirable in the first place...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?