Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable IIS to serve extension through web.config

Tags:

asp.net

iis

mime

I'm having some trouble with a website on a webhotel. It will not serve *.mp4 files - I simply get error 404.

Had I access to the server I'd add the mimetype in IIS, however I haven't :-(

The webhotel said they wouldn't customize their IIS for one customer, so I should enable it in my web.config instead.

Now my question is: how do I do this ?

I'm aware of the FileExtensions tag, but its default behaviour is to allow all extensions, so I doubt that's what they meant.

They're a bit slow to elaborate on these kinds of things, therefore I ask here :-)

like image 508
Steffen Avatar asked Aug 04 '11 16:08

Steffen


People also ask

Where is Web config file in IIS?

The configuration files for IIS 7 and later are located in your %WinDir%\System32\Inetsrv\Config folder, and the primary configuration files are: ApplicationHost. config - This configuration file stores the settings for all your Web sites and applications.


1 Answers

<configuration>
<system.webServer>
    <staticContent>
        <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
    </staticContent>
</system.webServer>
</configuration>

Obviously, don't repeat any sections that are already in your web.config just add the children in the appropriate places.

like image 115
James J. Regan IV Avatar answered Sep 22 '22 06:09

James J. Regan IV