Does anyone know if it is possible to add mime types to the XSP Webserver?
I'm working on a local Asp.net MVC application (Windows) that uses XSP as a lightweight server.
The problem is that XSP does not deliver the correct mime types for some files. One example is mp4, which gets the mime type "application/octet-stream" instead of "video/mp4".
This causes IE9/IE10 to offer a download dialog on those files instead of playing the videos natively.
I've tried to configure the mime type in web.config (which works for other servers like iis express)
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
But with no success.
This FAQ page http://www.mono-project.com/FAQ:_ASP.NET sounds not so promising:
... and it is also missing features like mime-type configuration and any other features that people expect from a web server.
But maybe there are undocumented ways to support different mime types...
With some support from a Mono developer I found a solution which is not specific to Mono.
Defining an HttpHandler:
web.config
MimeTypeHandler.ashx.cs