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.
- Open IIS Manager
- Click on the appropriate server, and in the Features View select “MIME Types”
- Click “Add…” on the right hand side
- Use the desired file extension in the “File name extension:” field, in my case I add .mp4.
- For the “MIME type:” field I use “video/mp4”, however this one will depend on the extension that you are using. Done!