Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Cannot Download Large Files


fotoruss

Recommended Posts

Posted

Hi everyone,

 

I submitted this question as a support ticket a week ago, but haven't had a response, so I'm hoping the greater community might be able to help me out. This same issue is also discussed in this thread: http://www.oscommerce.com/forums/topic/169570-large-file-download-timeouts/ however that thread has since been archived and therefore I'm unable to post on it.

 

I am running osCommerce version 2.3.3.4 and using the in-built download feature (not an extra download module). I am selling audio and video files that customers can purchase. There are no problems downloading the smaller audio files but there seems there is a problem downloading the larger video files.

 

All files are in .zip format and I believe I have followed the documentation and guides on the internet correctly, as I have numerous audio files that can be downloaded with no problem. A typical audio file may be between 50-110 MB, whereas the video files might be between 600 - 1300 MB. At this stage I have two video files (again, in .zip format), one is 600 MB and the other 1300 MB.

 

I have verified this myself and the problem is that when I try to download the larger video files the web browser begins to download but then almost immediately stops the download. I have tried Safari, Chrome and Firefox, all with the same results. The browser actually downloads and saves the correctly named .zip file, but it is normally around 200 bytes - obviously nothing near 600 - 1300 MB!

 

I have tried "download by re-direct" on and off and also toggled the download enable status to refresh it, but all have the same outcome.

 

These are the error messages I have seen from the browsers:

SafarI - Decompression failed or no error (it simply stops downloading after 1 second)

Firefox - File not found

Chrome - This webpage is not found

 

Because the browser actually saves the correctly named .zip file it tells me I have setup the download properly in osCommerce - there are no spelling errors or case sensitivity issues in the filename.

 

I have asked our hosting provider (SmartyHost) to change the php.ini file to increase these values to:

php_value post_max_size 2000M

php_value upload_max_filesize 20M

php_value max_execution_time 60

 

The hosting provider made this change by editing the .htaccess file. They did not restart apache as they inform me they do not need to if they are only editing the .htaccess file. I do not know if this is true or not?

 

This is a shared hosting situation, we do not have a dedicated virtual server, so I do not believe I have access to the php.ini file.

 

Unfortunately their change has not resulted in any success. The hosting provider asked me to thoroughly check the settings within the admin section of osCommerce to look for a maximum downloadable file size, which I have done, but cannot see such a setting. Am I missing something??

 

I am really quite stuck and at a loss as what to do.

 

Could you please advise? Your help would be most appreciated!

 

Regards,

 

Rusty

Posted

Hi Rusty,

 

why not just pack a zip in the download folder to test first if this is osCommerce or server narrow the problem down a bit

 

Call the file in your browser window and see if it downloads

 

http://www.your_site.com/download/your_file.zip

 

Make sure you are packing in zip format and not rar had a few problems with that.

 

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Posted

Try setting the max php memory limit higher to see if that helps - also you could try adding set_time_limit(0); at the top of the PHP file handling the download script

Posted

@@joli1811

 

Hi Joli, yes that's a brilliant idea, why didn't I think of that! *facepalm*

 

I just tested it by moving the problematic 1.3 GB .zip file into a publicly accessible folder and was successfully able to download it. Therefore, can we rule out the web hosting provider as the problem? If so, does that pretty much confirm the issue is with osCommerce?

 

The download folder is not publicly accessible, I had to move the .zip file into a different folder. It makes sense, because the download folder is protected so people can't guess the name of .zip files and start to download things. When a purchase is made osCommerce moves the file to a temporary folder with a random folder name and provides the link to the customer - obfuscation in action.

 

So my assumption then is that somewhere in the moving process osCommerce is not moving the file correctly or not providing the correct link or something to that sort. But this problem only appears for large files (what the MB cut-off point is I don't know).

 

What are your thoughts?

 

@@Bob Terveuren - Thank you for your comments. As my results have given us some more conclusive information, does this still apply?

 

Thank you,

 

Rusty

Posted

Since this is a download problem, I doubt that setting post_max_size and upload_max_filesize will have any effect. Do not use php_value and php_flag directives in .htaccess unless your server is so back-level that it does not support the php.ini file. It could very well be that PHP or the server itself is hitting some sort of process time limit. As you can successfully d/l a file of that size directly with a browser, I would lean towards PHP timing out. I don't believe that your browser is directly downloading from the directory, but is being fed the file being processed through osC (PHP). As @@joli1811 suggested, you might be able to turn off file/page compression (at least see if it helps). Otherwise you'll have to work with your host to see what's timing out or otherwise choking off the download of that size.

  • 2 weeks later...
Posted

Hi again,

 

Thank you for your replies. Just to give you an update, I was successfully able to download the large troublesome file if I move it out of the /download folder. Therefore I do not believe it is some obscure hard file size limit set by the web hosting provider. I agree that it appears to be an issue with PHP timing out. The web hosting provider has since increased the PHP max_execution time to 6000 (which is the equivalent of 100 minutes), but unfortunately that has not resolved the issue. A web developer that I have been using has also confirmed this:

 

"The issue is that the downloads web page is hitting a php limit of some sort (probably memory) - this page uses php to provide the download as its in a sub folder that is protected and it also checks that the client has access to this file.

 

When you access it directly from a url that is not in the downloads folder then you are directly accessing the file and this is not using php to do the download and so you are not subject to the php limit."

 

GZip compression was never turned on, so don't think that's the issue.

 

I have basically given up. I have accepted the fact that the service I am trying to provide is not best served by a shared web hosting environment, I need my own virtual server where I can fully manage PHP, apache, mysql etc.

 

I'm hoping this thread will provide some benefit for anyone else that may stumble across this issue in the future. My plan for now is to upgrade to my own virtual server and go from there. All being well hopefully I'll let you know how it goes.

 

Thanks again!

 

Rusty

Posted

Many people have successfully used osC for digital downloads, but I don't know if anyone has used it for gigabyte sized files. There is nothing intrinsic in osC that should choke on large files, but you may have run into some server limit (especially on a shared server) that just can't handle something that size without going casters up.

 

Does anyone know if osC attempts to read the entire file into memory at once, for processing and sending to the browser, or does it "stream" it through, a little at a time? If it tries to read the whole thing in for some reason, that's going to be a tough slog even for a VPS or dedicated server. It would be nice to know this before Rusty spends the money upgrading to a larger server.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...