Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Earth (.kmz) mime type iis issue

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!

like image 893
Jeremy Avatar asked Jul 07 '14 15:07

Jeremy


1 Answers

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>
like image 135
Matt Lengenfelder Avatar answered Oct 04 '22 09:10

Matt Lengenfelder