To play mp4 video in ASP.NET you may need to add a MIME-Type

This is also relevant for other video and audio file types that do not work.

I use Camtasia Studio to create video tutorials, but when I uploaded my video to my Web Site the other day I got this error:

HTTP Error 404.3 – Not Found
“The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.”

To fix this, we have 3 options.

1. If you have IIS access you can add mp4 to “Handler Mappings”.
2. In your Arvixe Control Panel, go to “Web Sites” Then click on the Web Site link to bring up it’s properties and add your missing MINE-Type as shown below in the image.

NOTE: This does not add the MINE-Type into your/our IIS.  Control Panel actually tries to add the lines below to your Web Sites Web.config file.
<staticContent>
<mimeMap fileExtension=”.mp4″ mimeType=”video/mp4″ />
</staticContent>

It tries to add this inside the <system.webServer> tag.
If your Web.config file is corrupt or not configured correctly, Control Panel can’t add this to the file and will give you an error.
(Ask me how I know this)  I had to get a properly formatted web.config file before Control Panel would add this for me.

***Also, next time you update your Web Application, you may get a new Web.config! Yikes!.  Do not forget to copy over this text change.  Control Panel will not know if the MIME-Type is removed from the Web.config file.  It will still show the MIME-Type as being there.

3. The other option is to add these lines to your Web.config file yourself in a text editor.

If you don’t know the exact file Extension and mimeType for the file you want to add, you can find it at this link.

Take Care and Happy Hosting!

Rick

Tags: , , , , | Posted under ASP .NET 2, ASP .NET 3.5, cPanel Tutorials, MojoPortal | RSS 2.0

2 Comments on To play mp4 video in ASP.NET you may need to add a MIME-Type

  1. Neo An says:

    I did it by editing web config file! Thanks so much!

  2. Renju Chingath says:

    Great!!

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 1 = 8

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>