21

I have some shared folder over HTTP. Lets say: http://myserver/files

And there are some filed like png, avi, jpg, mp4 and etc.

I can easily access *.png or *.avi via browser (http://myserver/files/555.avi) but cannot access to *.mp4.

So IIS gives the 404 error.

What's up?

Thank you!

UPDATES:

May be it is important: I have to access by this URL format

http://112.333.44.33/files/555.mp4

DmitryBoyko
  • 32,983
  • 69
  • 281
  • 458

4 Answers4

40

So I found the solution.

I just added correct MIME type to my website.

Extension: mp4

MIME type: video/mpeg

And now it works fine.

DmitryBoyko
  • 32,983
  • 69
  • 281
  • 458
  • 2
    Just added it in web.config and it works for me (Server 2008 R2 - IIS 7.5) Thanks :-) – Ramesh Chand Apr 18 '16 at 11:58
  • 1
    I added mime type in web config & it worked.Thank you. – Anup Shetty Jan 11 '18 at 07:48
  • 1
    Adding it in the web.config (no restart required) inside the staticContent tag should be enough: [link]https://blogs.iis.net/bills/how-to-add-mime-types-with-iis7-web-config – Deef Jul 16 '19 at 11:37
15

Add a MIME type with extension mp4 in IIS

But please note that you should set the MIME type video/mp4 instead of video/mpeg orelse in IE "Save Target As.." shows different format, and it also affects the default video player open by browser.

video/mpeg

File name: test.mpeg

Save as type: Movie Clip

video/mp4

File name: test.mp4

Save as type: MP4 Video

Eric
  • 5,445
  • 12
  • 20
1

I just had that issue, and I compared my IIS10 (win10) and IIS 7.5 (win2008 R2) applicationhost.config files, and these are the changes I sent from iis10 to iis75.

29 new types, and 5 modified.

Watch out for .ts if you use typescript... ts was a video file before being a programming language file

<!-- new types -->
<mimeMap fileExtension=".3g2" mimeType="video/3gpp2" />
<mimeMap fileExtension=".3gp2" mimeType="video/3gpp2" />
<mimeMap fileExtension=".3gp" mimeType="video/3gpp" />
<mimeMap fileExtension=".3gpp" mimeType="video/3gpp" />
<mimeMap fileExtension=".aac" mimeType="audio/aac" />
<mimeMap fileExtension=".adt" mimeType="audio/vnd.dlna.adts" />
<mimeMap fileExtension=".adts" mimeType="audio/vnd.dlna.adts" />
<mimeMap fileExtension=".appcache" mimeType="text/cache-manifest" />
<mimeMap fileExtension=".dvr-ms" mimeType="video/x-ms-dvr" />
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension=".jsonld" mimeType="application/ld+json" />
<mimeMap fileExtension=".less" mimeType="text/css" />
<mimeMap fileExtension=".m2ts" mimeType="video/vnd.dlna.mpeg-tts" />
<mimeMap fileExtension=".m4a" mimeType="audio/mp4" />
<mimeMap fileExtension=".m4v" mimeType="video/mp4" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".mp4v" mimeType="video/mp4" />
<mimeMap fileExtension=".oga" mimeType="audio/ogg" />
<mimeMap fileExtension=".ogg" mimeType="video/ogg" />
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
<mimeMap fileExtension=".otf" mimeType="font/otf" />
<mimeMap fileExtension=".spx" mimeType="audio/ogg" />
<mimeMap fileExtension=".svgz" mimeType="image/svg+xml" />
<mimeMap fileExtension=".ts" mimeType="video/vnd.dlna.mpeg-tts" />
<mimeMap fileExtension=".tts" mimeType="video/vnd.dlna.mpeg-tts" />
<mimeMap fileExtension=".webm" mimeType="video/webm" />
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
<mimeMap fileExtension=".wtv" mimeType="video/x-ms-wtv" />

<!-- modified types -->
<mimeMap fileExtension=".avi" mimeType="video/avi" />
<mimeMap fileExtension=".cab" mimeType="application/vnd.ms-cab-compressed" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".ics" mimeType="text/calendar" />
<mimeMap fileExtension=".js" mimeType="application/javascript" />
foxontherock
  • 1,676
  • 1
  • 13
  • 15
1

I just found the cause of the issue in my cpanel who give me this 404 on mp4 problem maybe is useful for someone, the file manager v3 happen to change the first character of the name of ".mp4" to a capital letter, so i get back and change my html and it works.

Alfangel
  • 11
  • 2