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" />`

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

  <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" />

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)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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