2

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" />`
LocalPCGuy
  • 123
  • 1
  • 5

1 Answers1

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)

agrath
  • 261
  • 2
  • 10