Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Downloaded File Error


3Dawn

Recommended Posts

Posted

Hi, I am really new to osC and am having trouble with my downloaded files working. I've spent about 2 days trying to figure out what isn't working. Any help is very appreciated.

 

Background Info:

My site runs on a Unix server, I have enabled Download By Redirect (= true). My site has an SSL certificate. My hosting company has a folder named httpdocs for non-secure documents and a folder name httpsdocs for secure documents. Right now I have to have my downloaded files in both download folders for osC to allow the download button to show correctly (but that is a separate issue).

 

I have tried different code in download.php - neither set of code makes a difference (shown here):

// Now send the file with header() magic

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

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

// header("Cache-Control: no-cache, must-revalidate");

// header("Pragma: no-cache");

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

// BOF Super Download Shop v1.1 mod

// header("Content-disposition: attachment; filename=\"" . $file_name . "\"");

// EOF Super Download Shop v1.1 mod

 

// 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

// header("Pragma: no-cache");

header("Pragma: "); // for stupid IE+SSL problem (IE thinks it mustn't save on SSL if no-cache is set)

// 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'] . "\"");

 

 

Problem:

When a user downloads a 13 Mb file it downloads in an instant as the file name that it should be -which is an EXE file.

Upon download the file is 1kb in size.

When I change the file type to .htm and open it I get the following information (some info hidden for security):

 

Warning: symlink(): SAFE MODE Restriction in effect. The script whose uid is 10053 is not allowed to access /home/httpd/vhosts/HIDDEN.com/httpdocs/pub/.nblzfqclrzspbjgut owned by uid 48 in /home/httpd/vhosts/HIDDEN.com/httpdocs/download.php on line 156

 

Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/HIDDEN.com/httpdocs/download.php:156) in /home/httpd/vhosts/HIDDEN.com/httpdocs/includes/functions/general.php on line 29

 

Questions:

I have temporarily set the pub folder to be wide open for read/write permissions by anyone to see if that helped - no difference. Any other ideas?

It appears that it is creating a temporary folder to copy the EXE file to, then downloading from there. Is that necessary?

The header information warning is suprising - I'm using the standard osC code and I am not finding other posts that have similar issues. Do I need the header information in the configure.php file?

 

THANK YOU AGAIN SO MUCH FOR ANY GUIDANCE. I don't know what to do.

 

- Kevin

Archived

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

×
×
  • Create New...