Here is the code from download.php
// 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']);
?>