Closed Bug 186821 Opened 22 years ago Closed 22 years ago

When downloading streamed data (with contenttype and header), "safe this file to disk" adds the page extension to the file name : foo.ext becomes foo.ext.asp

Categories

(SeaMonkey :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 65827

People

(Reporter: djnonsens, Assigned: asa)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5 I am using Active Server Pages (ASP) with an IIS webserver, and have files outside the wwwroot, which I want to be available for download. So I read the files in and then stream them to the browser. This works fine with IE, Opera and Netscape 6.2, but Netscape 7x and Mozilla1.X and Phoenix0.X rename the filename. Example: I have this file named foo.ext, and try to download that file with netscape 7.1. Netscape prompts the download dialog box, and want to rename foo.ext to: foo.ext.asp In this case, I am streaming an .xm file (audio filetype) to the browser, but I also had the same problems with other filetypes. Here is the ASP script I am using at http://www.exploitation.nl/test.asp: <% Response.Buffer = TRUE Response.Expires = 0 Response.ContentType = "application/xm" Response.AddHeader "Content-Disposition","filename=86.xm" strMyPath = "C:\somepath\86" Set objFileSys = Server.CreateObject("Scripting.Filesystemobject") Set objFile = objFileSys.GetFile(strMyPath) FileSize = objFile.Size Set objFile = Nothing Set objFile = objFileSys.OpenTextFile(strMyPath, 1, false, -1) Response.Clear Response.Flush Response.BinaryWrite(objFile.Read(FileSize)) Set objFile = Nothing Set objFileSys = Nothing %> You may test it for yourself at: http://www.exploitation.nl/test.asp You see? Netscape 6.X works fine, Netscape 7.X/Mozilla wants to rename the file. I saw some other posts about mozilla renaming filenames, but I didn't find anything like this. I am sorry if this bug is reported before. Reproducible: Always Steps to Reproduce: 1. Start Mozilla1.X / Phoenix0.X / Netscape 7.X 2. Go to http://www.exploitation.nl/test.asp Actual Results: Mozilla / Phoenix / Nestcape add the .asp extension to the filename. The filename is: 86.xm and the filename becomes 86.xm.asp Expected Results: Save the file to disk as 86.xm
> Response.AddHeader "Content-Disposition","filename=86.xm" This is invalid, you know... (we handle it, but I wish we didn't have to). You have to specify a disposition type. *** This bug has been marked as a duplicate of 65827 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
v.
Status: RESOLVED → VERIFIED
I am very sorry if I'm asking stupid questions, but I just don't get it: Is this bug fixed? Or are you trying to fix this bug? Or is it my ASP code? Anyway, I red the comments, and also checked the duplicates. Then I tried to "improve" my code, and tested it again (with Mozilla 1.3 alpha) at this new url: http://www.exploitation.nl/test2.asp This is the code I am using now: <% Response.Buffer = TRUE Response.Expires = 0 Response.AddHeader "Content-Disposition","attachement; filename=86.xm" Response.ContentType = "application/octet-stream" strMyPath = "C:\somepath\86" Set objFileSys = Server.CreateObject("Scripting.Filesystemobject") Set objFile = objFileSys.GetFile(strMyPath) FileSize = objFile.Size Set objFile = Nothing Set objFile = objFileSys.OpenTextFile(strMyPath, 1, false, -1) Response.Clear Response.Flush Response.BinaryWrite(objFile.Read(FileSize)) Set objFile = Nothing Set objFileSys = Nothing %> So if this bug is fixed, what am I doing wrong then? Please help... Would appreciate it if somebody could rewrite the correct ASP code for me (if it is an error in this code) Regards, Gerhard
This bug is not fixed... it's been marked duplicate of a still-open bug (and you've been cced on the open bug automatically so you can track its progress). Any fixing that happens will happen in that bug. I'm sorry if my comment was not clear. The lack of a disposition value and this bug are more or less orthogonal... (oh, and it's "attachment", not "attachement"). We should be handling the original code in the way you expected (listed under "Expected Results" in comment 0).
It is most likely also noticed that choosing "File/Safe page as" also gives problems: A normal asp page is saved as "page.asp.html" instead of page.asp
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.