I don't think I explained the problem properly. For the past year I've been able to download files on both Firefox and IE, it's only that the name of the file in the Save Link As box in Firefox appears as "index.php" each time. If I continue to download I get my .pdf file downloaded but saved as "index.php" IE picks up the correct name of the file automatically, not Firefox. I'm looking for a way to get Firefox to see the name in addition to its current ability to download the correct file. There is apparently a difference in the way IE and Firefox pick up a download file's file name, so I'm thinking perhaps Firefox needs the name placed in a different variable or something? More:
Do you have /pub set to 777 YES (I_USR with read/write)
How large are the download files? LARGE 18-95 MB
Do small download files work? ALL DOWNLOADS WORK, JUST THE NAME IS WRONG.
Do you have Redirect turned on in the Configuration ... Attribute Settings ... YES
Are you on a unix or windows server? WINDOWS 2003 SERVER
NOTE: windows servers should have this turned OFF IT'S BEEN WORKING GREAT FOR OVER A YEAR, WANT TO KEEP USING REDIRECT.
This is the code in header_php.php that works in 1.25 and now works in 1.35 (the name problem in Firefox occurs with this code running in either version):
// 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");
header("Content-disposition: attachment; filename=" . $downloads->fields['orders_products_filename']);
$zv_filesize = filesize(DIR_FS_DOWNLOAD . $downloads->fields['orders_products_filename']);
if (DOWNLOAD_BY_REDIRECT == 'true') {
// This will work only on Unix/Linux hosts
zen_unlink_temp_dir(DIR_FS_DOWNLOAD_PUBLIC);
$tempdir = zen_random_name();
umask(0000);
mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0777);
copy(DIR_FS_DOWNLOAD . $downloads->fields['orders_products_filename'], DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads->fields['orders_products_filename']);
zen_redirect(DIR_WS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads->fields['orders_products_filename']);
} else {
// This will work on all systems, but will need considerable resources
// We could also loop with fread($fp, 4096) to save memory
header("Content-Length: " . $zv_filesize);
readfile(DIR_FS_DOWNLOAD . $downloads->fields['orders_products_filename']);
}