Reputation: 5670
I've got an ASP.NET web application that allows users to download files from the site. This site has been running for a few years without an issue, but then today a user reported getting an 404 response when trying to download two different files with extensions of 'ERPT' and 'EDRW'. These are some kind of CAD design files.
In some cases, for example pdf files, the website will open the file in the browser. But for most, like zip files, the site will simply prompt the user for a download location and save the file. I expected the download to happen for these two files but it is returning the 404. If I change the file extension to txt, the download works without a problem.
Is there something unique about the ERPT or EDRW file extensions or is just that it is unknown?
Is there a work around, or something else I can put in my a tag?
Currently, the link is simply this:
<a href="files/File1.EPRT">Download File1.EPRT</a>
Upvotes: 1
Views: 2720
Reputation: 11725
Sounds like your IIS lost it MIME file types settings.
Here is an excerpt from Microsoft TechNet Requests for static files return 404 error (IIS 6.0):
For requests to static content, this version of IIS serves requests for files with known file name extensions only, a feature called Known Extensions. If a request is made for a resource whose file name extension is not mapped to a known extension in the MimeMap Metabase Property, IIS denies the request and logs a 404 error with the substatus code of 3 (404.3) in the W3C Extended log files (by default).
Upvotes: 2
Reputation: 2981
IIS 7 does not return unknown file types. Try adding this to your web.config
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".ERPT" mimeType="application/octet-stream" />
<mimeMap fileExtension=".EDRW" mimeType="application/octet-stream" />
</staticContent>
</system.webServer>
</configuration>
See here for more info.
Upvotes: 5