Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Downloadable files timing out


dancemad

Recommended Posts

Posted

Hi all,

 

My site consists of downloadable files only of which some are 200 megs in size. The downloads seem to be timing out at about 15 to 20 megs or a couple of minutes . If I buy-pass the store and url directly to the file, it downloads and decompresses fine.

 

You can duplicate this issue at www.downloadablespanishresources.com/spanishstore

The temporary CC module is installed for troubleshooting purposes so one can use 4111111111111111 for the cc number. I've created an account for troubleshooting as well. user: [email protected] pass: 123456

 

any help would be appreciated.

 

Michael

Posted

I've done some troubleshooting on different browsers, platforms etc and there seems to be the common thread of 60 seconds. This is when the downloads timeout no matter how fast the connection, how large the file etc....after 60 seconds the download quits and the file is unusable.

 

Hope this helps someone to trigger some useful knowledge into this frustrating issue.

Posted

After getting my isp invloved (ipower.com) and checking into max_execution_time settings in the php.ini server file, they responded with this:

 

To overcome this, please use header() function to redirect the request to the browser, to download the file. Currently, you are getting an pop-up download box which shows the progress bar. This is of Windows. You can have a progress bar built incorporated in the site itself, to show the progress. This way you can stop the download from timing out as this script will be refreshing the same. Please take the help of your web master.

 

Below is the code from download.php which seems to be the area they are talking about. If anyone can lead me in the right direction on this, I would appreciate it.

 

// Now send the file with even more header() magic;-)

// Date in the past

header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");

// always modified

header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

// HTTP/1.1

header("Cache-Control: private, no-store, must-revalidate, max-age=0");

header("Cache-Control: post-check=0, pre-check=0", false); // false=don't overwrite but add header

// HTTP/1.0

 

// Content stuff

header("Content-Length: " . filesize(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']));

header("Content-Type: application/octet-stream");

header("Content-Disposition: attachment; filename=\"" . $downloads['orders_products_filename'] . "\"");

 

if (DOWNLOAD_BY_REDIRECT == 'true') {

// This will work only on Unix/Linux hosts

tep_unlink_temp_dir(DIR_FS_DOWNLOAD_PUBLIC);

$tempdir = tep_random_name();

umask(0000);

mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0777);

symlink(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'], DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']);

if (file_exists(DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename'])) {

tep_redirect(tep_href_link(DIR_WS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']));

}

}

 

// Fallback to readfile() delivery method. This will work on all systems, but will need considerable resources

readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']);

?>

Archived

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

×
×
  • Create New...