Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We added both handlers and mime-types for IIS in the web.config to tell the server how to handle the different types of audio and video files we are using on the site. IIS does not seem to be respecting these mime-types, but is rather reverting to serving them via application/octet-stream (which is the default for "unknown" file types).

The files are served properly in a dev environment locally, but on the QA and Prod servers, even when using the exact same settings (and verifying by checking in IIS that the mime-types are showing), the files do not serve properly.

Any ideas on how to proceed? We have exhausted most of the basic ideas and compared configs and system setup from dev to QA numerous times.

Code example:

<remove fileExtension=".mp4" />`
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />`
share|improve this question

1 Answer 1

Apparently you can't override this in a location tag or even in your web.config like so:

<staticContent>
  <mimeMap fileExtension="woff" mimeType="application/x-font-woff" />
  <remove fileExtension="ogg"/>
  <remove fileExtension="mp4"/>
  <remove fileExtension="webm"/>
  <mimeMap fileExtension="ogg" mimeType="video/ogg" />
  <mimeMap fileExtension="webm" mimeType="video/webm" />
  <mimeMap fileExtension="mp4" mimeType="video/mp4" />
</staticContent>

Instead, I had to add .mp4 under mime types in the GUI (this doesn't appear to have altered web.config at all) as a local definition:

mp4 mime type in iis GUI

Confirmed with fiddler, the .mp4 is now served with a content type of video/mp4 (even though the staticContent tag was defined previously)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.