Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Large product download


thefoxrox

Recommended Posts

Posted

I am downloading self extracting zip from my oscommerce site set-up. Small files of under a 100k are fine but larger fils are being corrupted on download, anyone any ideas why theis is happening or how to get around it.

 

I am usin Winzip to create zip files and winzip self extractor to turn them into .exe's. I have a lot of larger files I wish to download. All help appreciated

Posted

If you are NOT on an IIS webserver, try setting admin->configuration->download->down_load_direct to true.

 

Might work, might not. There is also a max limit setting in PHP that your can look into.

 

HTH

Tom

Posted
I am downloading self extracting zip from my oscommerce site set-up.  Small files of under a 100k are fine but larger fils are being corrupted on download, anyone any ideas why theis is happening or how to get around it.

 

I am usin Winzip to create zip files and winzip self extractor to turn them into .exe's.  I have a lot of larger files I wish to download.  All help appreciated

 

 

This limit is set by your Hosting provider....

 

Mike

  • 1 month later...
Posted

The problem is a memory limit with PHP in your host server. By default, PHP script memory is 8MB, which is not enough for downloads > 3MB

 

Try getting a copy of your host's php.ini file, then put a copy of it in the OsCommerce catalog/ folder, and change the setting:

memory_limit = 8M    ; Maximum amount of memory a script may consume (8MB)

to something like

memory_limit = 20M    ; Maximum amount of memory a script may consume (8MB).

 

You might want to contact your host company because this will take considerable resources. You will want to change the last part of your download.php file from

 

 

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

 

 

to

 

 

$fp = fopen(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'],'r');
while(!feof($fp)) {
   $buffer = fread($fp, 4096);
print $buffer;
}
fclose($fp);

 

 

to prevent using too many resources and your host company getting pissed off at you. :'(

 

Hope this helps!

~Jorge

Archived

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

×
×
  • Create New...