Problem opening kmz files from IE

66 views
Skip to first unread message

DanielC

unread,
Jul 19, 2005, 10:51:24 AM7/19/05
to KML Discussions
Google has some sample kmz links on their web site (e.g. http://services.google.com/earth/kmz/GrandCanyon.kmz). If I click on the link, IE asks me to choose to open it (with Google Earth) or save the file as you'd expect.

I wanted to provide some kmz links on my own web site, but when I click the link to my kmz file (http://www.christinesbeachcottage.com/ct_virtual_tour.kmz), IE changes the extension from .kmz to .zip, and treats it as if it's a zip file. Even if I right-click on it & choose "Save Target as...", IE pops up with the dialog box asking where I want to save "ct_virtual_tour.zip" (Note: There is no file named ct_virtual_tour.zip on my site!).
The problem is not limited to my site, as I get the same problem when I click on links to kmz files on some forum sites.

This seems specific to my setup: Windows XP + SP2 running IE 6 with all updates. I don't get this problem when I test using my laptop running Windows 2000 with IE 6, or from my Linux setup running Firefox.

As a test, I copied Google's "GrandCanyon.kmz" file to my site, but again when I download it using IE, IE wants to open or save it as "GrandCanyon.zip".

Anyone seen a problem like this or has any ideas? How is it that my IE opens a kmz file correctly when it's on the Google site, but changes its extension to .zip when I open or download it from my site?

dropzone

unread,
Jul 19, 2005, 11:09:27 AM7/19/05
to KML Discussions
DanielC,

you need to configured your webserver to send the correct MIME types to the browser. More explanation is at the KML tutorial:

http://www.keyhole.com/kml/kml_tut.html

5 KML Server requirements
When responding to a request from the Google Earth client, a KML server must follow a certain set of rules so that the client can correctly interpret responses.

Upon success, the server must return a response code of HTTP 200 and set the response's content-type to a suitable MIME type.
Google Earth reads KML and KMZ files, and the MIME types for these are:
application/vnd.google-earth.kml+xml kml
application/vnd.google-earth.kmz kmz
The body of the response must contain valid KML data, including the xml declaration header (<?xml version="1.0" encoding="UTF-8"?>). If the server returns invalid KML, the Network Link will stop deactivate and output an error message.

DanielC

unread,
Jul 27, 2005, 3:15:52 AM7/27/05
to KML Discussions
Thanks very much

I used the "Mime Types" utility in CPanel to do this. It added the following lines to the .htaccess file in the same directory as my kmz file:

AddType application/vnd.google-earth.kml+xml kml
AddType application/vnd.google-earth.kmz kmz

JohnBoZ

unread,
Jul 28, 2005, 6:47:44 PM7/28/05
to KML Discussions
Hi Daniel,

I have exact the same problem on my (dutch) site.

http://www.webkwestie.nl/google_earth_columbus/verwerking_02.htm

It's a educational site. When the student clicks on "KLIK HIER". He gets de zip-problem.

I see that there is a solution (?), but I don't understand how the problem is solved. Can you give me a example? I'm not a technical men, so if you can give me a simple explantion or example, I would be very happy.

Greetings,

John Demmers
Netherlands

Hulk

unread,
Jul 28, 2005, 11:55:00 PM7/28/05
to KML Discussions
Well technically a KMZ file IS a zip file, so its not doing that much wrong But don't you have a web master who can set the MIME types for you?

JohnBoZ

unread,
Jul 29, 2005, 5:16:53 AM7/29/05
to KML Discussions
Hi Hulk,

I am just a simple webmaster.
Could you send a example of such a code?
Or could you refer to a webpage where a can study the html-code?

Greetings,

John Demmers

horizon

unread,
Jul 29, 2005, 10:36:20 AM7/29/05
to KML Discussions
John, there are two options for Apache servers.

1. If you have root access find the mime.types file on your server and add two new lines:
application/vnd.google-earth.kml+xml kml
application/vnd.google-earth.kmz kmz

2. Or create a .htaccess file in the directory where your html files are stored and add two lines to .htaccess:

briantos

unread,
Sep 20, 2005, 5:01:14 PM9/20/05
to KML Discussions
Hi there,

I added the code to .htaccess on my Apache server. It worked great for the .kmz file, but if I establish a hyperlink to a kml file, it simply displays the contents of the file:


<?xml version="1.0" encoding="UTF-8" ?>
- <kml xmlns="http://earth.google.com/kml/2.0">
- <Placemark>
<name>New Placemark</name>
- <LookAt>
<longitude>-96.44467995828418</longitude>
<latitude>40.43171495313342</latitude>
<range>24672630.37205456</range>
<tilt>2.058821340121152e-012</tilt>
<heading>0.23622985662122</heading>
</LookAt>
<visibility>1</visibility>
<open>0</open>
<styleUrl>root://styleMaps#default+nicon=0x307+hicon=0x317</styleUrl>
- <Point>
<extrude>0</extrude>
<tessellate>0</tessellate>
<altitudeMode>clampToGround</altitudeMode>
<coordinates>-96.44467995828418,40.43171495313342,0</coordinates>
</Point>
</Placemark>
</kml>
Reply all
Reply to author
Forward
0 new messages