How do I configure IIS 6.0 to allow .exe files to be downloaded?
IIS 6.0, when it was first released, was a lot more locked down than previous versions of Microsoft’s web server software and as such simply balked at being asked to serve unknown file types. Obviously this is a bit of a headache if you want your web server to act more like a fileserver than anything else and in this quick post we are going to look at the common problem of trying to get your web server to serve .exe files to your users.
Firstly, check the logged error message you get when trying to access an executable file on your server. Should IIS return a 404.2 error then you know that IIS is in fact trying to execute that executable on the server and because there is no defined Web Service Extension for that executable path, IIS is returning that particular error code.
Obviously if you are looking to allow users to download .exe files from your site, this is not the behaviour you desire and to turn it off, you simply need to make sure that you change the execution permissions option to “Scripts only” instead of “Scripts and Executables” under the Home Directory tab of your site’s property sheet in the IIS Management Console.
With the execute permissions now firmly set to “Scripts only”, try and download that executable again. Should it again fail, check the error code and you should be seeing a 404.3 error. This means that IIS’ inbuilt MIME map policy prevented the request.
To changes this, go to the HTTP Headers tab of the site’s property sheet in the IIS Management Console and click on the MIME Types button. Add a new extension by entering .exe and setting the type to application/octet-stream.
Apply the changes and your website’s MIME map policy should now allow .exe requests and by extension make you a far happier web administrator.