PDA

View Full Version : osCommerce Download Problem


Info_Haven
8-27-07, 06:00 PM
Hello Everyone,

Have a customer that has an osC shop with a downloadable product. The file size is about 28MB.

The problem is that it "almost" downloads with out a hiccup...seems that around 24mb to 27mb (it varies) the zip file just "finishes", giving the impression that the file has downloaded successfully, except when you click on the ZIP file it comes up corrupt (actually unrecognizable zip file). I thought is was an IE Pragma issue, but that solution didn't work.

Has anybody else seen this and/or know the solution to this? I've search this forum, but haven't found anything nor on Google.

Thanks in advance!

HalfaBee
8-27-07, 06:17 PM
You are probably hitting the 1 minute script timeout.

There is a php/html workaround in the php forum, not totally satisfactory but it should work.

Info_Haven
8-27-07, 06:34 PM
Thank you for the suggestion. The download doesn't take over 60 seconds, but none the less I increased the "max_execution_time = 120".

However, still getting the download to fail at the end. Is there another setting I'm missing?

Thanks again!

HalfaBee
8-27-07, 07:23 PM
Have you tried it with a small download?

Info_Haven
8-27-07, 07:37 PM
I hadn't as since I could go directly to the file and download it with out incident, however when I do try a small file I now get the following:
(File gets downloaded to 99%)
Connection with the server was reset.

Guess I have another problem.

EDIT:
OK, found an error in my download.php - fixed it and the 1.5MB file downloaded with out any problems. Retry the 28MB file and it seems to be giving out at 25.5mb. Is there a PHP.ini setting limiting the download to 25.5MB on Powweb?

2nd EDIT:
Thought the timeouts were at 25.5MB, but after trying numerous times, the timeout fails at different intervals: 22MB / 27MB / 25MB, etc.

What am I missing here? Thanks for any help!!!

YvetteKuhns
8-28-07, 02:49 PM
Could you change the download for your customer to a small zipped file with instructions how to login to download the purchased zipped file from a password-protected directory?

Use .htaccess and .htpasswd to protect the directory or create a temporary login to gain access to that zipped file which should be the only file in its directory. Direct downloads are faster than those through the php script.

Info_Haven
8-28-07, 03:00 PM
Hi Yvette,

Thanks you for the suggestion, unfortunately the owners of the shop are not that computer savy, thus the use of osC as an alternative purchase=download method.

Do you know off the top of your head if Powweb has either a DL limit or whether they allow or not the function set_time_limit ?

Thanks again!

YvetteKuhns
8-28-07, 03:04 PM
I think you are hitting the php/cgi timeout limit. You can edit the php.ini file, but only to the limitations of the server.

YvetteKuhns
8-28-07, 03:08 PM
Edit your php.ini to increase your upload_max_filesize (and IMPORTANT your post_max_size) to allow larger uploads.

Info_Haven
8-29-07, 10:26 AM
Hi Yvette,

Thank you for the suggestion - I had done that, but to no avail. I sent an email to Powweb and got a response regarding the set_time_limit function:

"The PHP session time out is set to 60 seconds in the new servers. The reason for this is because other files will have an opportunity to be executed within this period. Unfortunately, you will not be able to increase the time out settings for the PHP file execution.

The servers/load balancer will kill any process that hasn't responded in the last 60 seconds (to prevent resources from getting hung up in a process that is stalled). Hence, customer may not be able to upload large sized files using this upload script.

Unfortunately, there's not much we can do about this right now, but I will certainly bring the issue up with our Network Operations team to see if we can address extending the timeout somewhat."

Of course, I'm looking for a download-non-timeout solution, but I guess the PHP script will still timeout.

Luckily, I was able to utilize an osC contribution as well as break the download into smaller pieces for the shop to handle without timing out. (That's the solution for now.)

Thanks again!

YvetteKuhns
8-29-07, 10:34 AM
The PHP session time out is set to 60 seconds in the new servers. The reason for this is because other files will have an opportunity to be executed within this period. Unfortunately, you will not be able to increase the time out settings for the PHP file execution.

That has been implemented for a while. This is a shared server, so no one expects this to change.

Luckily, I was able to utilize an osC contribution as well as break the download into smaller pieces for the shop to handle without timing out. (That's the solution for now.)

I figured that was the only thing that could work right now with your script. Unless you can find a php script that will resume download if interrupted that works, you have a solution for now.