How do you enable download of files with unknown ext, no ext whilst keeping valid ext?

How do you enable download of files with unknown ext, no ext whilst keeping valid ext?

Post by peeping_ » Fri, 04 Jul 2008 13:28:05



Hi,

I'm trying to set up an Internal HTTP File Share with IIS 6.0 on
Win2K3SP1, but I can't figure out how to enable the IIS server to
return files with no extensions as well as files with unknown
extensions whilst allowing known file types, html, txt etc, to be
returned with the correct mime type.

If I add mime mapping "." -> application/octet-stream I can download
files with no extension, known files get returned with the correct
mime type, but I can't download files with unknown extension e.g.
foo.bar.

If I add mime mapping ".*" -> application/octet-stream I can download
files with no and unknown extensions, but valid extensions are also
returned as application/octet-stream, making it impossible to read
html files and txt files in the browser (other than IE that actually
inspects the contents of the file).

Is it impossible to configure IIS 6.0 to allow for these 3 rules?
1. Files with no extension must be returned as application/octet-
stream
2. Files with unknown extensions must be returned as application/octet-
stream
3. Files with known extension must be returned with the corresponding
mime type.

Cheers

CM
 
 
 

How do you enable download of files with unknown ext, no ext whilst keeping valid ext?

Post by David Wan » Sat, 05 Jul 2008 16:05:20


Correct. You will not be able to configure built-in IIS features to
behave like that because the IIS StaticFile Handler does not work like
that. It is possible to extend IIS such that your own handler will
behave like that.


//David
http://www.yqcomputer.com/
http://www.yqcomputer.com/
//