Adding SQL MIME type to IIS 7

To download a SQL file from an IIS hosted website the website needs to know how to handle the file.

In general terms a SQL file is plain text, so the respective MIME type would be text/plain

This can be added to IIS manually using the MIME types editor. Or for a more reliable approach add the MIME type to your application web.config file – this will make the settings portable so they get deployed with the application (and will work on any instance of IIS), for example;


<configuration>

    <system.webServer>

        <staticContent>

            <mimeMap fileExtension=".sql" mimeType="text/plain" />

     </staticContent>

    </system.webServer>

</configuration>

Comments

Leave a comment