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>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

A WordPress.com Website.

Up ↑

%d bloggers like this: