IIS 7 404 file not found, when the file really does exist

What the heck?

I recently ran into an issue on an IIS 7.5 Server where I had uploaded a file to the server for a site, but when I went to view the file I received a 404 File not found error. Now I knew that the file did indeed exist, I even double checked just to verify, yet IIS still threw the 404 error. I was also sure the directory was configured correctly and permissions were not an issue. Then I started to think maybe it was something specific to the format/extension of this particular file. The format I was trying to use in this case was .mp4, which is a common video format.

MIME Types

As it turns out .mp4 is not a native MIME Type in Windows Server 2008 R2/IIS 7.5. To fix this issue, all I did was manually add the extension in IIS Manager. This method will also work for any other file extension that is not natively supported. I also added .iso and .7z to my list.

  1. Open IIS Manager
  2. Click on the appropriate server, and in the Features View select “MIME Types”
  3. IIS Console - Select MIME Type

    IIS Console - Select MIME Type

  4. Click “Add…” on the right hand side
  5. Use the desired file extension in the “File name extension:” field, in my case I add .mp4.
  6. IIS Console - Add MIME Type

    IIS Console - Add MIME Type

  7. For the “MIME type:” field I use “video/mp4”, however this one will depend on the extension that you are using. Done!

Comments are closed.