Can't download KML or KMZ files from web site

1,929 views
Skip to first unread message

OwyheeRover

unread,
Jan 10, 2006, 9:02:41 PM1/10/06
to KML Discussions
I am not able to download KML and KMZ files from my own website, yet I can open them from other sites. I have no trouble downloading other file types from my web site.

The only thing I can think of is that my site is running FrontPage extensions, but I don't know if this matters or not.

When I try to open a KML or KMZ file from my website, I get a “page not found” message. Strangely, when I change the file extension to something else, the file downloads just fine.

I even went so far at to take a KMZ file and give it a different extension, and take other common files and give them KMZ or KML extensions. In each case, the KML and KMZ extensions fail, and the common file extensions can be downloaded, not matter what the actual file contents are.

For example, I can download these files

www.kunafarmersmarket.com/test/kmz.gif (this is actually a KMZ file, and it downloads fine)
www.kunafarmersmarket.com/test/gif.gif (this is a gif file)
www.kunafarmersmarket.com/test/text.txt (this is a text file)
www.kunafarmersmarkect.com/test/excel.xls (this is an excel file)

However I cannot download the following files, even though they are exact copies of the files above. The only difference is that they have been renamed to have KML or KMZ file name extensions.

www.kunafarmersmarket.com/test/kmz.kmz
www.kunafarmersmarket.com/test/gif.kmz
www.kunafarmersmarket.com/test/text.kml
www.kunafarmersmarket.com/test/excel.kml

The message I get is

The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. 404 Etc, etc…



Yet, I can open kml and kmz files that are on other sites. For example

http://autodesk.blogs.com/between_the_lines/2005/06/google_earth_co.html

The link to http://autodesk.blogs.com/between_the_lines/files/Autodesk-CivicCenter.kmz works fine for me.


This is quite a puzzle. Any ideas?

Thanks,
Bill Clark

Forkboy2

unread,
Jan 11, 2006, 11:40:47 AM1/11/06
to KML Discussions
If it helps, I get page not found errors on your pages also. Have you checked to make sure the capitalization of the letters is the same on the website and in the link?

Matt

encleadus

unread,
Jan 11, 2006, 7:21:58 PM1/11/06
to KML Discussions
OwhyheeRover,
Check out this post
http://bbs.keyhole.com/ubb/showflat.php?...true#Post232934

You might need to add the MIME types (see the above post) to your server and then it should work. Hope that helps.

OwyheeRover

unread,
Jan 12, 2006, 1:24:21 AM1/12/06
to KML Discussions
Very helpful. Thanks for checking to see if you had the same problem. The capitilization of the URL, one way or the other, has no effect.

ozlingula

unread,
Jan 12, 2006, 1:44:28 AM1/12/06
to KML Discussions
Just confirming (not that it helps much), but I get the ...


"The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. "

message with all four KML/KMZ files.


HOWEVER :

The file :

Quote:

www.kunafarmersmarket.com/test/kmz.gif (this is actually a KMZ file, and it downloads fine)




reports as a ZIP file with my Internet Explorer.

www.kunafarmersmarket.com/test/gif.gif (this is a gif file) works fine (a blue star).
www.kunafarmersmarket.com/test/text.txt (this is a text file) works fine.
www.kunafarmersmarkect.com/test/excel.xls (this is an excel file) gives the Page Not Found error.

I'm sorry, but I have no useful suggestions ....

OwyheeRover

unread,
Jan 12, 2006, 1:55:48 AM1/12/06
to KML Discussions
Google Earth - if you are reading this, can anything be done to add KML and KMZ files to the IIS default list of MIME types?

I think encleadus is correct. I did some testing and discovered that indeed, IIS does not deliver file types unknown to it. For example, I renamed a gif file to "gif.kljsaf" and get the same "file not found" error.

Here is what Microsoft says:
http://support.microsoft.com/default.aspx?scid=kb;en-us;326965

The big challenge is that I don't really own my own server. I have an account with an internet provider..

I will ask them if they could add MIME types. I will keep you posted.

Kdetroit

unread,
Jan 13, 2006, 11:12:20 AM1/13/06
to KML Discussions
Anyone come up with a javascript solution for this? I just want to add a KML to my webpage and when clicked, the window pops up to either open in GE or download. Even after explaining to right click + save, alot of newbie users still just click and get my raw KML text, and that leads to alot of emails

I found this, but can't get it to work:

<html>
<body>
<script>
function downloadme(x){
myTempWindow = window.open(x,’’,’left=10000,screenX=10000’);
myTempWindow.document.execCommand(’SaveAs’,’null’,x);
myTempWindow.close();
}
</script>

<a href=javascript:downloadme("/test.pdf");>Download this pdf</a>
</body>
</html>

Jason_Birch

unread,
Jan 14, 2006, 12:53:12 AM1/14/06
to KML Discussions
I can't think of any way of doing this in javascript.

If you have access to a server-side scripting language, then you can work around your host's MIME types. I'm doing this with PHP (not to work around MIME types, but it's the same concept) but it should be possible in Perl, Python, C, ASP, ASP.Net, sh, etc...

Basically, your links would point to a script with a unique identifier for the file you want to send as an argument. The script then sends the appropriate content-type header and streams the file's content to the end user.

Jason

OwyheeRover

unread,
Jan 14, 2006, 2:05:05 PM1/14/06
to KML Discussions
Happily, my ISP added the KML and KMZ MIME types. In the meanwhile, I developed an ASP script to work around the problem, which I might keep, as it seems to offer me more control over the process...

Kdetroit

unread,
Jan 16, 2006, 10:08:13 AM1/16/06
to KML Discussions
Believe it or not I was able to add MIME Types myself!

If your ISP offers cPanel, you can click on the MIME types icon, and add the Google Earth apps under 'user defined.'

It took about 2 hours and then all my KMLs started to open in GE. I don't think they restarted the server.
Reply all
Reply to author
Forward
0 new messages