Internet Information Services (IIS, formerly Internet Information Server) will not return file types that are not added to the
<staticContent> element or that have mappings in the
<handlers> element by default.
This behavior prevents unauthorized access to files that do not have mappings in the IIS configuration settings.
The message returned is:
“The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.”
Fix this issue by adding a mime type to the web server or application. To add to the application, make a web.config file and place it on your root folder.
In this example, I added mime types for SVG, TTML, VTT and WOFF files, which I use in a Chromecast receiver application:
<configuration> <system.webServer> <staticContent> <mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> <mimeMap fileExtension=".ttml" mimeType="application/ttml+xml" /> <mimeMap fileExtension=".vtt" mimeType="text/vtt" /> <mimeMap fileExtension=".woff" mimeType="application/font-woff" /> </staticContent> </system.webServer> </configuration>
Sometimes your browser might display this message back for a response:
“The page cannot be displayed because an internal server error has occurred”
When this happens, make sure you tell the server to remove the map before adding it. This will usually happens with file types like XML that are listed on IIS by default:
<configuration> <system.webServer> <staticContent> <remove fileExtension=".xml" /> <mimeMap fileExtension=".xml" mimeType="application/xml" /> </staticContent> </system.webServer> </configuration>
To learn more, go to the IIS website. And happy coding!