How to Fix Internet Explorer Cannot Download FileName from WebServer

Tuesday, January 19, 2010
You may find that when you create a link to a file from your web server that Internet Explorer cannot download or open the file.  When the user clicks the link, Internet Explorer returns the generic 404 error, as shown:

They also may receive an error stating, "Internet Explorer cannot download filename.ext from www.server.com.  Internet Explorer was not able to open this Internet site.  The requested site is either unavailable or cannot be found. Please try again later."

This happens when IIS doesn't understand the file extension and associated content type of the file.  Examples of such file extensions are .reg or .gadget.  To fix this problem you must add the extension and MIME type to IIS.

Here's how you do it in IIS 7.0 (Windows Server 2008) and IIS 7.5 (Windows Server 2008 R2):
  • Open Internet Information Services (IIS) Manager
  • Expand servername > Sites > Default Web Site
  • Select the website you want to configure, or select Default Web Site if you want to configure all websites on the server
  • Double-click MIME Types in the IIS section of the center pane
  • Click Add in the Actions pane
  • Enter the extension you wish to add, including the . prefix (i.e., .reg or .gadget)
  • Enter the MIME type (i.e., text/plain for .reg files or application/x-windows-gadget for .gadget files)
  • Click OK
The changes go into effect immediately - there's no need to restart IIS.

For a quick reference of MIME types, see MIME Type Detection in Internet Explorer.

No comments:

Post a Comment

Thank you for your comment! It is my hope that you find the information here useful. Let others know if this post helped you out, or if you have a comment or further information.