I had some users complaining that when they tried to click on a few links of a webpage we host that they were getting a weird error in Internet Explorer saying that the file didn’t exist. I got them to send me a screenshot of the error and I found it was a 404 error that looks like this:
404 – File or Directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
So whenever anyone was clicking the link to this file and a few other files (all were MP4 files that they should have been able to download from or view on our page) were giving this error. What I found was that my settings in IIS 6 weren’t correct and I needed to add the right MIME types for the file so that my media server could serve them up properly. I had forgotten to add these MIME types when I found out that we would be hosting files of this type.
To add these MIME types is pretty simple, I will explain what the MIME type is for and how to add them and a few other MIME types into your IIS setup, this should resolve this error. So basically when you add MIME types to IIS you are telling the server what types of files extensions it understands. Files end with things like (.doc) (.xls) (.exe) to specify the type of file they are. Well in IIS you need to tell it how to interact with the files its server and make file types known to IIS so it can host them properly.
So to add these MIME types here is what you do:
Open IIS (command line inetmgr)
Expand the Server Name
Expand the websites
Right Click on the website you want to edit
Click the HTTP Headers Tab
Click MIME Types button
Click New button
Type in the extension type (.mp4 is mine)
Type in the MIME Type (video/mp4 is mine)
After the IISRESET has completed you can test your webpage again and verify that the error is gone. The files should work properly now, there is a possibility you will need to reboot the server but its highly unlikely but if the files still don’t work you should try a reboot next.
If you are in need of a list of MIME types this site HERE offers a load of the most common MIME types and what you need to enter in IIS to make them work.