![]() |
|
|
|
#1 |
|
I have an application whose installer can be downloaded from the Internet as an MSI file (by
clicking on a link). The content-type parameter is set to application/octet-stream. Under Firefox, this works fine. However, under IE, the file is downloaded as an "unknown type", and the file extension is stripped off. How do I go about preserving the MSI file extension under IE? - Mark Mark Olbert |
|
|
|
|
#2 |
|
Posts: n/a
|
Is it stripped off by IE because it is listed on that machine as a known
file extension? <Mark Olbert> wrote in message news:... >I have an application whose installer can be downloaded from the Internet >as an MSI file (by > clicking on a link). The content-type parameter is set to > application/octet-stream. > > Under Firefox, this works fine. However, under IE, the file is downloaded > as an "unknown type", and > the file extension is stripped off. > > How do I go about preserving the MSI file extension under IE? > > - Mark |
|
|
|
#3 |
|
Posts: n/a
|
Ken,
I'm confused. Why would it be stripped because it's a known extension? Why would the extension ever be stripped? FWIW, msi is a known extension on at least my machine (which exhibits the problem). - Mark On Sat, 15 Jan 2005 12:50:05 -0500, "Ken Cox [Microsoft MVP]" <> wrote: >Is it stripped off by IE because it is listed on that machine as a known >file extension? |
|
|
|
#4 |
|
Posts: n/a
|
Hi Mark,
Here's an article that offers something of an explanation: File Extensions Are Lost When Saving Files from the Internet http://support.microsoft.com/default...b;en-us;176106 Ken <Mark Olbert> wrote in message news:... > Ken, > > I'm confused. Why would it be stripped because it's a known extension? Why > would the extension ever > be stripped? > > FWIW, msi is a known extension on at least my machine (which exhibits the > problem). > > - Mark > > On Sat, 15 Jan 2005 12:50:05 -0500, "Ken Cox [Microsoft MVP]" > <> wrote: > >>Is it stripped off by IE because it is listed on that machine as a known >>file extension? > |
|
|
|
#5 |
|
Posts: n/a
|
If you're using IE 4.0, it's a problem.
The problem was fixed in IE 4.01 and later. -------------------------------------------- From that KB article : ---------------------- CAUSE This problem can occur if Internet Explorer 4.0 is installed and the "Hide file extensions for known file types" (or "Hide MS-DOS file extensions for file types that are registered") check box is selected. STATUS This behavior no longer occurs in Internet Explorer 4.01 Service Pack 1. -------------------------------------------- That shouldn't be your problem, currently, Mark, since at least IE 5.01 is needed to install the .Net Framework. Why are you setting the content-type parameter at all ? For a simple download link, you don't need to set the content-type parameter to application/octet-stream. My question to you is : Why don't you use a standard HTML <a href...> tag ? I just tried it with the WebMatrix.msi file, like this : <a href="WebMatrix.msi">WebMatrix</a> and it works just fine. If you need for the file to be somewhere else, you can change the directory path to fit your needs. If you have special needs ( like the file being selected dynamically instead of being a static link), there's many ways that can be achieved. Juan T. Llibre ASP.NET MVP =========== "Ken Cox [Microsoft MVP]" <> wrote in message news:uNJzz13%... > Hi Mark, > > Here's an article that offers something of an explanation: > > File Extensions Are Lost When Saving Files from the Internet > > http://support.microsoft.com/default...b;en-us;176106 > > Ken > <Mark Olbert> wrote in message > news:... >> Ken, >> >> I'm confused. Why would it be stripped because it's a known extension? >> Why would the extension ever be stripped? >> >> FWIW, msi is a known extension on at least my machine (which exhibits the >> problem). >> >> - Mark >> >> On Sat, 15 Jan 2005 12:50:05 -0500, "Ken Cox [Microsoft MVP]" >> <> wrote: >> >>>Is it stripped off by IE because it is listed on that machine as a known >>>file extension? >> > |
|
|
|
#6 |
|
Posts: n/a
|
The article is contradictory. Look at the Applies to section:
APPLIES TO .. Microsoft Internet Explorer 1.0 .. Microsoft Internet Explorer 2.0 .. Microsoft Internet Explorer 3.0 .. Microsoft Internet Explorer 3.01 .. Microsoft Internet Explorer 3.02 .. Microsoft Internet Explorer 4.0 128-Bit Edition .. Microsoft Internet Explorer 4.01 128-Bit Edition .. Microsoft Internet Explorer 5.0 .. Microsoft Internet Explorer 5.01 Service Pack 3 .. Microsoft Internet Explorer 5.5 Service Pack 1 .. Microsoft Internet Explorer 3.2 .. Microsoft Internet Explorer 4.0 128-Bit Edition .. Microsoft Internet Explorer 2.01 .. Microsoft Internet Explorer 3.0 .. Microsoft Internet Explorer 3.01 .. Microsoft Internet Explorer 3.02 .. Microsoft Internet Explorer 4.0 128-Bit Edition .. Microsoft Internet Explorer 4.01 128-Bit Edition .. Microsoft Internet Explorer 5.0 .. Microsoft Internet Explorer 5.01 Service Pack 3 .. Microsoft Internet Explorer 5.5 Service Pack 1 "Juan T. Llibre" <> wrote in message news:u%23OwHs4%... > If you're using IE 4.0, it's a problem. > The problem was fixed in IE 4.01 and later. > -------------------------------------------- > > From that KB article : > ---------------------- > CAUSE > This problem can occur if Internet Explorer 4.0 is installed > and the "Hide file extensions for known file types" > (or "Hide MS-DOS file extensions for file types > that are registered") check box is selected. > > STATUS > This behavior no longer occurs > in Internet Explorer 4.01 Service Pack 1. > -------------------------------------------- > > That shouldn't be your problem, currently, Mark, > since at least IE 5.01 is needed to install the .Net Framework. > > Why are you setting the content-type parameter at all ? > > For a simple download link, you don't need to set the > content-type parameter to application/octet-stream. > > My question to you is : > Why don't you use a standard HTML <a href...> tag ? > > I just tried it with the WebMatrix.msi file, like this : > <a href="WebMatrix.msi">WebMatrix</a> > and it works just fine. > > If you need for the file to be somewhere else, > you can change the directory path to fit your needs. > > If you have special needs ( like the file being selected > dynamically instead of being a static link), there's many > ways that can be achieved. > > > > Juan T. Llibre > ASP.NET MVP > =========== > "Ken Cox [Microsoft MVP]" <> wrote in message > news:uNJzz13%... >> Hi Mark, >> >> Here's an article that offers something of an explanation: >> >> File Extensions Are Lost When Saving Files from the Internet >> >> http://support.microsoft.com/default...b;en-us;176106 >> >> Ken > >> <Mark Olbert> wrote in message >> news:... >>> Ken, >>> >>> I'm confused. Why would it be stripped because it's a known extension? >>> Why would the extension ever be stripped? >>> >>> FWIW, msi is a known extension on at least my machine (which exhibits >>> the problem). >>> >>> - Mark >>> >>> On Sat, 15 Jan 2005 12:50:05 -0500, "Ken Cox [Microsoft MVP]" >>> <> wrote: >>> >>>>Is it stripped off by IE because it is listed on that machine as a known >>>>file extension? >>> >> > > |
|
|
|
#7 |
|
Posts: n/a
|
So what would it be?
"Juan T. Llibre" <> wrote in message news:u%23OwHs4%... > If you're using IE 4.0, it's a problem. > The problem was fixed in IE 4.01 and later. |
|
|
|
#8 |
|
Posts: n/a
|
I think it's the setting of the content-header.
Just using a regular HTML link works fine for clients downloading MSI files. I suppose that using an ASP.NET hyperlink would work, too. Juan T. Llibre ASP.NET MVP =========== "Ken Cox [Microsoft MVP]" <> wrote in message news:euz5ut8%... > So what would it be? > > "Juan T. Llibre" <> wrote in message > news:u%23OwHs4%... >> If you're using IE 4.0, it's a problem. >> The problem was fixed in IE 4.01 and later. > |
|
|
|
#9 |
|
Posts: n/a
|
Ken,
Thanx for the lead. I'll check with the client, but I'm pretty sure she has IE6 installed (she's running an XP Home box). The article doesn't reference IE6 as having the problem. Do you know if it still exists on that platform? - Mark On Sat, 15 Jan 2005 22:42:53 -0500, "Ken Cox [Microsoft MVP]" <> wrote: >Hi Mark, > >Here's an article that offers something of an explanation: > >File Extensions Are Lost When Saving Files from the Internet > >http://support.microsoft.com/default...b;en-us;176106 > |
|
|
|
#10 |
|
Posts: n/a
|
Okay, now I'm confused. The download process is triggered by the user clicking on an ASP.NET link
button. Here is the code fragment called when the link is clicked: if( File.Exists(toDownload) ) { theFile = new FileInfo(toDownload); Response.Clear(); // specify that the response is a stream that cannot be read by the // client and must be downloaded Response.ContentType = "application/octet-stream"; // add the header that specifies the default filename for the // Download/SaveAs dialog Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName); // add the header that specifies the file size, so that the browser // can show the download progress Response.AddHeader("Content-Length", theFile.Length.ToString()); // send the file stream to the client Response.WriteFile(theFile.FullName); // stop the execution of this page Response.End(); } Is some part of this in error? Again, it works fine under Firefox running on the same platform. And, now that I think about it, the "hide file extension" settings referred to in an earlier post can't be the reason, because the download process truncates the extension on my development machine, and I know for a fact that I have "show every darn file extension you can" set file extensions seems like an evil and pernicious act to me So something else is going on here.... - Mark On Sun, 16 Jan 2005 09:25:51 -0400, "Juan T. Llibre" <> wrote: >I think it's the setting of the content-header. > >Just using a regular HTML link works >fine for clients downloading MSI files. > >I suppose that using an ASP.NET >hyperlink would work, too. > |
|