Skip to main content

Serving up KML in IIS 6

To serve up KML in IIS 6, you have to add a few MIME Types. The easiest way to do this is to apply new MIME Type settings globally by changing the properties on your server's "Web Sites" folder in IIS.


Google Earth reads KML and KMZ files. The MIME type for KML files is

* application/vnd.google-earth.kml+xml

The MIME type for KMZ files is

* application/vnd.google-earth.kmz

Source: Google KML Tutorial


To add a MIME type to a Web site or directory

1. In IIS Manager, right-click the Web site or Web site directory for which you want to add a MIME type, and click Properties.

2. Click the HTTP Headers tab.

3. Click MIME Types.

4. Click New.

5. In the Extension box, type the file name extension.

6. In the MIME type box, type a valid MIME type. If you define a MIME type that has already been defined at a higher level, you are prompted to select the level where the MIME type should reside.

To create a MIME type for an undefined MIME type, type an asterisk (*) in the Extension box, and type application/octet-stream in the MIME type box.

To create a MIME type for a file without an extension, type a period (.) in the Extension box, and type your MIME type in the MIME type box.

7. Click OK.

Source: Microsoft TechNet

Comments

Idaho said…
In Classic ASP, another solution is to add a line of code at the head of your file. This comes in handy when you don't have Server Admin priveleges.

I do not know how it crosses over to .net, however.

(% Response.ContentType = "application/vnd.google-earth.kml+xml" %)