Downloaded files get upper case extension after move (OS2's isExecutable() causes file extensions to be uppercased)

VERIFIED FIXED

Status

()

Core
XPCOM
VERIFIED FIXED
10 years ago
10 years ago

People

(Reporter: Peter Weilbacher, Unassigned)

Tracking

({verified1.8.1.8})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
When downloading files from some servers, the downloaded filename has an upper-cased extension after it was moved to the final destination.

To reproduce:
- go to http://hobbes.nmsu.edu/cgi-bin/h-viewer?sh=1&fname=/pub/os2/dev/util/mzfntcfgft_20070528.zip
- click on the mzfntcfgft_20070528.zip link
- the download begins
- during the download one one can see two files in the destination directory, mzfntcfgft_20070528.zip and mzfntcfgft_20070528.ZIP.part
- when the download has completed, the final file name is mzfntcfgft_20070528.ZIP

Expected result:
It should be named mzfntcfgft_20070528.zip

This happens with Firefox 2.0.0.x but not with SeaMonkey 1.1.x or 2.0a1pre.
Seamonkey uses completely different download manager code.

Does this work the same on trunk?
(Reporter)

Comment 2

10 years ago
Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.9a8pre) Gecko/2007090919 Minefield/3.0a8pre
No, this trunk build behaves exactly the same.
(Reporter)

Comment 3

10 years ago
This is caused by isExecutable() that is called from the validateLeafName function in nsHelperAppDlg.js. Apparently this does not happen for SeaMonkey?

I have looked at that code before and didn't notice that it works on the input char string instead of copying it into an extra buffer before uppercasing it for comparison...
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Reporter)

Comment 4

10 years ago
Created attachment 280273 [details] [diff] [review]
use extra buffer

This should do it. It also removes the non-high memory WinUpper fallback because that is really not needed.
Assignee: nobody → mozilla
Status: NEW → ASSIGNED
Attachment #280273 - Flags: review?(mozilla)

Comment 5

10 years ago
Interesting. Using Tabmixplus 0.3.6 with "Prevent blank tabs when downloading files" NOT checked and "Save link as..." it comes out *.zip. Clicking directly on the file name as Peter described yields *.ZIP as reported.
(Reporter)

Comment 6

10 years ago
Phil, "Save link as..." first presents you a file picker dialog, right? Whatever you type in it should override any other guesses.
Assignee: mozilla → nobody
Status: ASSIGNED → NEW
Component: Download Manager → XPCOM
Product: Firefox → Core
QA Contact: download.manager → xpcom
Summary: Downloaded files get upper case extension after move → Downloaded files get upper case extension after move (OS2's isExecutable() causes file extensions to be uppercased)

Comment 7

10 years ago
(In reply to comment #6)
> Phil, "Save link as..." first presents you a file picker dialog, right?
> Whatever you type in it should override any other guesses.
>

I thought it would, but it doesn't. 

Both present me with the "file picker" dialog, with the .zip lowercase. One stays that way, the other changes.

Getting PS files from arXiv.org (http://xxx.arxiv.cornell.edu/ in the US) the "file picker" presents with no extension. Adding .ps results in *.PS on disk, because effectively direct click is the only way allowed.

Updated

10 years ago
Attachment #280273 - Flags: review?(mozilla) → review+
(Reporter)

Comment 8

10 years ago
Fix checked in to trunk and 1.8 branch.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Keywords: fixed1.8.1.8
Resolution: --- → FIXED
(Reporter)

Comment 9

10 years ago
Verified as fixed with the branch nightly
   Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.8.1.8pre)
   Gecko/20071003 BonEcho/2.0.0.8pre
and my own build from trunk
   Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.9a9pre)
   Gecko/2007100301 Minefield/3.0a9pre

I also verified that file extensions added to files when downloading from http://xxx.arxiv.cornell.edu/list/astro-ph/recent (via Save Link As... from the context menu) stay lower case.
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1.8 → verified1.8.1.8
You need to log in before you can comment on or make changes to this bug.