IIS returns 404 not found for .mp4 files

I used the hmtl video tag to play the video. In my local video, but when I posted. It does not play. I created a project based on ASP.NET. I use this method locally.

http://localhost:41563/files/Just.mp4 

and when i posted url give me this error:

  http://111.111.22.22:41563/files/Just.mp4 

404 - No file or directory found. The resource you are looking for may be deleted, its name changed or temporarily unavailable.

How can i solve this.

+4
source share
2 answers

Check if I have an IIS MIME type for mp4 added for a hosted site (or for the directory in which you have your video files).

There is already one for Win Server 2012, but for Win Server 2008 it is not enabled by default.

So, if you developed / tested on WinSer2012 and then deployed on WinSer2008, you may get this problem.

Mp4 settings MIME: File name extension: .mp4 MIME type: video / mp4

+11
source

The MIME type can also be added via Web.config, just in case your IIS is on Azure:

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

https://blogs.iis.net/bills/how-to-add-mime-types-with-iis7-web-config

+1
source

Source: https://habr.com/ru/post/916992/


All Articles