Closed Bug 511624 Opened 16 years ago Closed 9 years ago

Right click and save as adds the extension to .txt to .bat files, resulting in .bat.txt

Categories

(Firefox :: File Handling, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mozilla, Unassigned, NeedInfo)

References

()

Details

(Keywords: regression)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 When you right click on a link to a batch file and click save as, it will allow you to save it, but it automatically adds .txt to the end of the filename without informing you. You are unable to save it as <file>.bat This issue is also reported here: http://forums.mozillazine.org/viewtopic.php?f=38&t=871385&start=0 Reproducible: Always Steps to Reproduce: 1.Right click on a batch file link 2.Click save as 3.Save it Actual Results: filename is file.bat.txt Expected Results: filename expected to be file.bat
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.3a1pre) Gecko/20090819 Minefield/3.7a1pre I see something similar (saved as bat.htm). This worked fine in Firefox 2.0x but not anymore when Firefox 3.0 came out.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Version: unspecified → Trunk
Users downloading .bat files from my site are still having problems with this... In case you didn't understanding, try the following... 1. Visit http://hm2k.googlecode.com/svn/trunk/code/batch/ 2. Right click on any of the files in that directory, and click save link as... 3. Choose where to save it, and press the "Save" button. 4. The file is saved as "file.bat.txt" instead of "file.bat" as expected.
Testet Firefox 3.5.5 and Firefox 3.6 on XP and Win7 and i get the same renaming "problem" as described. I tried to download .reg files and not .bat files and the downloaded file was renamed to .reg.txt.
I discovered a work around. If you add a asc(7) character in your batch file, it tricks firefox into thinking it is a binary and treats it as such. This means it doesn't change the file extension to .bat.txt and instead saves it as is.
If you have server access and the server software supports .htaccess files the following seems to work inside a .htaccess file <FilesMatch "\.bat$"> Header unset Content-Type Header unset Content-Disposition Header set Content-Disposition attachment Header set Content-Type application/octet-stream Header add Content-Type application/force-download Header add Content-Type application/download Header unset Content-Transfer-Encoding Header set Content-Transfer-Encoding binary </FilesMatch> This forces Firefox to recognize .bat files as binary applications preventing it from adding .txt behind the downloaded file.
Firefox, 50.0a1, Build ID 20160616030228 User Agent Mozilla/5.0 (Windows NT 5.1; rv:50.0) Gecko/20100101 Firefox/50.0 I have tested this issue on the latest Firefox (47) release and latest Nightly (50.0a1) build and is no longer reproducible. For testing I have used http://www.dostips.com/DtCodeBatchFiles.php, the batch files are successfully downloaded with the ".bat" extension. Is this still reproducible on your end ? If yes, can you please retest this using latest Firefox release and latest Nightly build (https://nightly.mozilla.org/) and report back the results ? When doing this, please use a new clean Firefox profile, maybe even safe mode, to eliminate custom settings as a possible cause (https://goo.gl/PNe90E).
Flags: needinfo?(mozilla)
Considering the fact that I cannot reproduce this and the fact that the reporter did not answered to my request until now, I will mark this as Resolved-Worksforme. If anyone can still reproduce it, feel free to reopen the issue and provide more information.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.