Forums / All Other Contributions/Addons / Firefox Downloads don't show file name

Firefox Downloads don't show file name

Locked

Views: 2,375

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
30 Sep 2006, 12:46 PM
#1
cphilips avatar

cphilips

New Zenner

Join Date:
Jun 2005
Posts:
18
Plugin Contributions:
0

Firefox Downloads don't show file name

In both 1.25 and my upgrade to 1.35, when I right-click on a download link and click Save Link As in Firefox, the Save As dialog box that appears shows "Index.php" as the default name in the Name box. It isn't picking up the .pdf filename. However, in IE6 the link shows up correctly.

Has anyone else experienced this and better yet, no a way to get Firefox to display the pdf file name as the default?

30 Sep 2006, 1:31 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Firefox Downloads don't show file name

Do you have /pub set to 777

How large are the download files?

Do small download files work?

Do you have Redirect turned on in the Configuration ... Attribute Settings ...

Are you on a unix or windows server?

NOTE: windows servers should have this turned OFF

If on unix, and you turn this OFF does it work?

If so, check with your hosting site about the .htaccess and why it is not handling the .htaccess file:

#prevent directory browsing -- for security
IndexIgnore /

Options +FollowSymLinks -Indexes

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Sep 2006, 8:00 PM
#3
cphilips avatar

cphilips

New Zenner

Join Date:
Jun 2005
Posts:
18
Plugin Contributions:
0

Re: Firefox Downloads don't show file name

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']);
}

30 Sep 2006, 8:09 PM
#4
cphilips avatar

cphilips

New Zenner

Join Date:
Jun 2005
Posts:
18
Plugin Contributions:
0

Re: Firefox Downloads don't show file name

I should add (Windows server people might want to know this), that a year ago some one posted here a one-line "fix" to the REDIRECT that enabled it to run on Windows 2003 Server. In the modified 1.25 code shown in the previous e-mail, the line that reads

copy(DIR_FS_DOWNLOAD . $downloads->fields['orders_products_filename'], DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads->fields['orders_products_filename']);

is the only changed from the native 1.25 code whose line reads

symlink(DIR_FS_DOWNLOAD . $downloads->fields['orders_products_filename'], DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads->fields['orders_products_filename']);

Changing from symlink to copy has enabled it to work for me, other than the name issue.