SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru james_littler's Avatar
    Join Date
    May 2007
    Location
    Portsmouth, UK
    Posts
    775
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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
    James

  2. #2
    Non-Member thewebhostingdir's Avatar
    Join Date
    Oct 2005
    Posts
    703
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  3. #3
    SitePoint Guru james_littler's Avatar
    Join Date
    May 2007
    Location
    Portsmouth, UK
    Posts
    775
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  4. #4
    SitePoint Guru james_littler's Avatar
    Join Date
    May 2007
    Location
    Portsmouth, UK
    Posts
    775
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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!

  5. #5
    SitePoint Guru james_littler's Avatar
    Join Date
    May 2007
    Location
    Portsmouth, UK
    Posts
    775
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

    Thanks
    James

  6. #6
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,053
    Mentioned
    66 Post(s)
    Tagged
    1 Thread(s)
    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.

  7. #7
    SitePoint Guru james_littler's Avatar
    Join Date
    May 2007
    Location
    Portsmouth, UK
    Posts
    775
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  8. #8
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,053
    Mentioned
    66 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by james_littler View Post
    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

    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:

    PHP Code:
    header ('Content-length: '.filesize($fileToSendPath)); 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •