By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,960 Members | 987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,960 IT Pros & Developers. It's quick & easy.

MIME Type for MSI Download

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
9 Replies


P: 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:q4********************************@4ax.com...
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


Nov 19 '05 #2

P: 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]" <BA************@sympatico.ca> wrote:
Is it stripped off by IE because it is listed on that machine as a known
file extension?


Nov 19 '05 #3

P: 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:6v********************************@4ax.com...
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]"
<BA************@sympatico.ca> wrote:
Is it stripped off by IE because it is listed on that machine as a known
file extension?


Nov 19 '05 #4

P: 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]" <BA************@sympatico.ca> wrote in message
news:uN****************@TK2MSFTNGP10.phx.gbl...
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:6v********************************@4ax.com...
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]"
<BA************@sympatico.ca> wrote:
Is it stripped off by IE because it is listed on that machine as a known
file extension?

Nov 19 '05 #5

P: 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" <no***********@nowhere.com> wrote in message
news:u%******************@TK2MSFTNGP15.phx.gbl...
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]" <BA************@sympatico.ca> wrote in message
news:uN****************@TK2MSFTNGP10.phx.gbl...
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:6v********************************@4ax.com...
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]"
<BA************@sympatico.ca> wrote:

Is it stripped off by IE because it is listed on that machine as a known
file extension?



Nov 19 '05 #6

P: n/a
So what would it be?

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:u%******************@TK2MSFTNGP15.phx.gbl...
If you're using IE 4.0, it's a problem.
The problem was fixed in IE 4.01 and later.


Nov 19 '05 #7

P: 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]" <BA************@sympatico.ca> wrote in message
news:eu****************@TK2MSFTNGP15.phx.gbl...
So what would it be?

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:u%******************@TK2MSFTNGP15.phx.gbl...
If you're using IE 4.0, it's a problem.
The problem was fixed in IE 4.01 and later.

Nov 19 '05 #8

P: 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]" <BA************@sympatico.ca> 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


Nov 19 '05 #9

P: 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 :) because hiding
file extensions seems like an evil and pernicious act to me :). I'm also running XP Pro SP2 and IE6+

So something else is going on here....

- Mark

On Sun, 16 Jan 2005 09:25:51 -0400, "Juan T. Llibre" <no***********@nowhere.com> 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.


Nov 19 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.