Results 1 to 5 of 5
Jul 9, 2013, 03:53 #1
- Join Date
- Sep 2009
- Toulouse, France
- 0 Post(s)
- 0 Thread(s)
Timeouts on Apache and PHP downloads
I run a website which sells audio downloads for doctors. At present when a customer buys a podcast he/she is shown a direct HTML link to start the download. The link points to a ZIP file which can be 1Gb in size. One question I ask is, why can the download operate successfully for perhaps some hours when the Apache server has a timeout of perhaps a few mins? I presume this timeout is for the server to process the GET request and to sent the resultant output to the browser via an output buffer. Perhaps there is no timeout for the buffer to be transmitted to the user. Am I correct?
My second question is about PHP timeouts. I'm not keen on an HTML direct link to a download as if the URL became known to other users they could download for free. A solution could be to use a PHP script to transfer the download file by sending the appropriate headers then, say, an 'echo' of a variable preloaded with the download data. My question is whether the timeouts in the php.ini file would effect the download. These are usually 30 secs for the script to complete. So, is the script running during the download? Alternatively does the script complete quickly and put the download data into a PHP output buffer. If the latter, is there any timeout for the buffer to empty?
I presume I'd have to set a large value for the 'memory_limit' in php.ini (128Mb by default) to allow for the size of the 1Gb download.