Reputation: 141
It is a little annoying that every time when you put a "new" file-extension on your IIS 7.5 backed server for simple http-download you have to think about adding the extension to the IIS configuration!
(e.g. provide a file zipped in the format .7z)
Is there a way to tell IIS "serve anything" (like it is the default setting in Apache-Webserver) ?
Thanks
Upvotes: 14
Views: 14011
Reputation: 6232
You should add the following to the MIME types:
For files with any extension (i.e. foo.somethingcrazyhere)
extension: .*
MIME type: application/octet-stream
For files without any extension (i.e. SOMETHING_CRAZY_HERE_NO_DOT)
extension: .
MIME type: application/octet-stream
Upvotes: 10
Reputation: 26157
You should add the following to the MIME types:
extension: .*
MIME type: application/octet-stream
After that (depending on the browser) every unknown file will be forced to download.
Upvotes: 17
Reputation: 37232
Try the following in your web.config. This basically tells IIS to ignore the extension whitelist.
<configuration>
<system.webServer>
<security>
<requestFiltering>
<fileExtensions allowUnlisted="true" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
Upvotes: -2