Google Earth (.kmz) mime type IIS issue
Asked Answered
B

1

8

I am experiencing a peculiar issue with IIS and KMZ files. I have added the MIME type to IIS and it works just fine -- however, seemingly randomly the MIME type is removed. This has happened a few times now, and each time all I have to do to fix the issue is just add the MIME type again.

The issue is identified when broken links are reported, and as soon as I add the MIME type back in all is well.

Any thoughts on what is causing it, or methods for finding out what's causing it?

Thanks!

Batts answered 7/7, 2014 at 15:30 Comment(0)
S
17

My guess is that someone is overwriting or modifying your web.config file. You can modify the web.config using either the IIS server tools or by publishing the project containing the web.config file. If you are modifying your IIS settings using IIS Manager, then every time someone re-publishes the web application it changes those settings. Make sure the correct settings are saved in your web.config in your root VisualStudio project. So that whenever that project is published it's setting the correct IIS settings.

<configuration>

  <system.webServer>
    <staticContent>
      <remove fileExtension=".kml" />
      <mimeMap fileExtension=".kml" mimeType="application/vnd.google-earth.kml+xml" />
      <remove fileExtension=".kmz" />
      <mimeMap fileExtension=".kmz" mimeType="application/vnd.google-earth.kmz" />
    </staticContent>
  </system.webServer>

</configuration>
Seen answered 9/7, 2014 at 19:51 Comment(1)
I am marking this as the answer, because based on your explanation I am almost 100% positive this is what is happening. The mime type was being added in IIS Manager as opposed to the web.config, and the web.config is updated relatively infrequently, which would explain the seemingly "random" disappearance of the type. Our QA reports are generated every 5 days, so when the broken links are reported, it is not necessarily the day it broke. Thanks a bunch!Batts

© 2022 - 2024 — McMap. All rights reserved.