Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Download file size above 2.0MB fails?


phillipgrizzell

Recommended Posts

Phil,

 

I had the same problem as you, what worked for me was under Configuration, Download, I had to set Download by redirect to true. As so as I did, I was able to download anything. Biggest file I have tried is 474 megs.

 

Hope this helps.

 

Anthony

Link to comment
Share on other sites

Hi,

 

I have tried it both ways now with rediredt and without, still no joy.

 

I had it working perfectly on a cobalt RaQ4i with php 4.2 on it, then moved to an ensim 3.5.19 box with php4.3.3, i think its to do with php tho. I have tried it with upload_max_filesize set to 10M and even 0 for unlimited, still no joy. I have even used a file in the virtual area of etc/maxsize with 10M for file size but still no joy.

 

any ideas will be taken for a test and lets hope it works ;)

 

Phil

Link to comment
Share on other sites

Well ive again tried changing the upload max to 10M and it failed,

ive even re-installed the latest ms2.2 on my server and still get this error, so it looks like its down to PHP:(

 

Anyone got any other ideas, i'm getting rather frustrated now.

Please help!!!!!

 

 

Rgds

Phil

Link to comment
Share on other sites

From a note in php.net:

 

Watch out when you use readfile to read big files ! Reading a file of 6 meg will result in php using 6 megs of memory ! Php might stop your script if you cross the memory limit. You're better of using fread when reading big files.

 

 

If DOWNLOAD_BY_REDIRECT (which BTW will only work on Linux/Unix servers...) is FALSE

 

See your download.php - about line 95

// This will work on all systems, but will need considerable resources
// We could also loop with fread($fp, 4096) to save memory
   readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']);

 

Try:

// This should work on all systems.
// old code: readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']);
  $filename = DIR_FS_DOWNLOAD . $downloads['orders_products_filename'];
  $handle = fopen ($filename, "r");
   fread($handle, filesize ($filename));

 

The OTHER option is to change your MEMORY LIMIT in php.ini

 

Default is:

memory_limit = 8M

 

Increase to whatever your largest download is plus an extra 2 or 3 MB.

 

I hope this helps!

 

Good luck.

Link to comment
Share on other sites

From a note in php.net:

 

Watch out when you use readfile to read big files ! Reading a file of 6 meg will result in php using 6 megs of memory ! Php might stop your script if you cross the memory limit. You're better of using fread when reading big files.

 

 

If DOWNLOAD_BY_REDIRECT (which BTW will only work on Linux/Unix servers...) is FALSE

 

See your download.php - about line 95

// This will work on all systems, but will need considerable resources
// We could also loop with fread($fp, 4096) to save memory
   readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']);

 

Try:

// This should work on all systems.
// old code: readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']);
  $filename = DIR_FS_DOWNLOAD . $downloads['orders_products_filename'];
  $handle = fopen ($filename, "r");
   fread($handle, filesize ($filename));

 

The OTHER option is to change your MEMORY LIMIT in php.ini

 

Default is:

memory_limit = 8M :huh:

 

Increase to whatever your largest download is plus an extra 2 or 3 MB.

(this can be set in httpd.conf or .htaccess also - appartly)

I hope this helps! B)

 

Good luck.

Link to comment
Share on other sites

  • 2 weeks later...

Hi JPF,

 

I tried it but it didnt make one bit of difference......... :huh:

 

i just cannot understand why on a cobalt raq4i it worked a treat

but on an emsim box it dont work....

 

I have PHP 4.3.3 on the ensim .....on the cobalt i think it was 4.2.?

 

Still hoping for a cure.......

:D

 

 

Phil

Link to comment
Share on other sites

  • 5 years later...

I am a newbie setting up a store with downloadable content and having the same problem. Small files work fine. Large files (28.6mb zip file) don't download properly. The download button is there in every case. I read in another forum that gzip and downloads don't play well together and have had some success when gzip is turned off, but is there any other advice regarding this? It is extremely frustrating!

 

Any advice appreciated. thanks in advance!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...