Maximum download size, php.ini?

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

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.

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.

Any ideas?

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!

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?


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.

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.

Only affects uploads. max_input_time :smiley:

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));