james_littler — 2009-08-12T09:16:05-04:00 — #1
Hi, I'm trying to set up my site to allow downloads of over 3mb (largest I have managed to download).
This is for a digital downloads site which uses joomla and maian music.
I have been advised by the creator of the maian music component that the problem may be to do with my php.ini file.
I've used phpinfo(); to print the following:
Is there anything in there that you can see which would be limiting my max download size?
I've been looking through this for a while and the only thing I can see which looks related is 'upload_max_filesize' which is set to 100M so that shouldnt be a problem.
Thanks in advance
system — 2009-08-12T10:16:23-04:00 — #2
No, there is no download size limit setup. In general, download file size is not restricted. You can HTTP-download the file of any size.
james_littler — 2009-08-12T10:22:01-04:00 — #3
I'm not sure what's going on then.
If I try to download a 3mb file it works fine, if I then try to download a 20mb file (same link, I just renamed the file for download) I get the following screen after 3 or 4 seconds
In IE8 I get a transfer box which just says 0% and never gets anywhere.
james_littler — 2009-08-12T10:40:12-04:00 — #4
Well I've just spoken to tech support at my host (not naming names(co)), and it seems there's an un-resolved problem with their server meaning that when the download is initiated the running of php scripts times out the download.
How brilliant is that!
james_littler — 2009-08-12T11:44:26-04:00 — #5
I've just received an email from the tech support team saying the following:
There are no issues with the servers configuration regarding how PHP operates with file transfer. The reason this issue is failing is due to the PHP script continuing to run in the background whilst the file is downloaded. This causes a timeout error if the file takes too long to download. Although this is partially related to the PHP.ini settings there is nothing more we can do regarding the configuration as the current settings are optimised for shared hosting usage.
If you are still having issues with this then it may be worth investigating alternatives to PHP related scripts when downloading files.
So is there a way I can terminate the script when the download is initialised?
michael_morris1 — 2009-08-12T14:22:21-04:00 — #6
Your hosts are stupid. max_input_time is set to 60 seconds, I'm surprised you pulled a 3 MB upload in that time limit, let alone your 100 MB target. Change that setting to 0 to turn it off or set it to 3600 like your execution time.
james_littler — 2009-08-13T04:15:58-04:00 — #7
Hi, thanks for the response.
Would that have any effect on download or is just for upload?
My problem is with downloads rather than uploads.
michael_morris1 — 2009-08-16T09:30:40-04:00 — #8
Only affects uploads. max_input_time
Downloads are affected by script execution time. However, if you use read_file it shouldn't be an issue since that function hands a file to the webserver to send to the client. If it is then the issue is probably in the webserver, not PHP.
Hmmm... I have had file size issues when I didn't send my file size header, particularly with IE. That may be the problem here. Try this:
header ('Content-length: '.filesize($fileToSendPath));