Help with publishing kml files on the web

46 views
Skip to first unread message

ed_aus

unread,
Sep 22, 2006, 11:20:07 PM9/22/06
to KML Discussions
Ok, I've searched for answers on this forum and other websites but with only a partial luck. I'm obviously missing something very basic... any assistance much appreciated. Here are the details of my problem:

I want to add kml files to my web page so when users click on the <a href> link 'download' option is activated (so the file can be loaded into GE).

I have added to the server (apache) recommended mime types for kml and kmz as per instructions.

IE recognizes mime type and fires up download function.

FireFox (1.0) still opens my file as text in the browser. Other pages that publish kml files are working fine (eg kml links on the oficial web site activate download function without any problem).

Any suggestions on what may be going wrong here?

Thanks

PenguinOpus

unread,
Sep 23, 2006, 6:37:24 AM9/23/06
to KML Discussions

IE is able to recognize downloads based strictly on file extension. If you don't _actually_ have the mimetype set up correctly on the server, then Firefox will treat it as a blind file download and offer to open it with the owner of that filetype (don't ask me why the "use this program from now on" checkbox seems to have no effect).

Install the "Live Http Headers" plugin for Firefox and watch what mimetype is actually being served when you download the file. I just visited several websites and the ones that gave me the FF "Open" dialog box all seem to be sending "text/plain" (implying that the mimetype isn't really set up correctly).

Alternatively, post a link to your file and I'll take a look.


http://livehttpheaders.mozdev.org/

ed_aus

unread,
Sep 23, 2006, 10:06:29 AM9/23/06
to KML Discussions
Thanks PenguinOpus, I did not anticipate that adding a simple kml to a web site can be so complicated! And there is no reference to any of this in the documentation... or is it just me?!

Anyway, link to FF plug-in was very helpful but it brought more questions!

I noticed that google own page http://earth.google.com/earth4.html returns content type text/html when clicked on kml link - not text/plain (but page has no declarations on top... should it matter?). It works fine in my FF and IE.

Tagzania, for example http://www.tagzania.com/blog/news/kml-links-in-maps-pasted-elsewhere, returns proper kml content type Content-Type: application/vnd.google-earth.kml+xml kml
when clicked on kml link. Again, works in both FF and IE.

But when I click on the link on my page strange thing registers... generator tab shows "get" request to a file but header tab shows only this strange (?) call http://toolbarqueries.google.com.au/sear...&q=info:... link to file.kml

I do have a google toolbar but the above is not happening with other pages...

Meantime I managed to stuff up my mime types... on local host no matter what I do neither FF nor IE wokrs (ie changed mime.types and mime.types.default files for proper google types, text/plain and text/html - one at a time - without any difference whatsoever). On my ISP site I firstly added google types and only IE worked. Now I added also type text/plain but everything reverted to just opening files in a new browser page - worse, I cannot delete my new additions! I'll have to wait til Monday... SO frustrating! I'll post the link to the page once I sort it out.

Surely there must be an easier way... others have somehow figured it out. Anyone care to share?

Cheers

Aplmac

unread,
Sep 23, 2006, 10:33:08 AM9/23/06
to KML Discussions
Quote:


FireFox (1.0) still opens my file as text in the browser.





Firefox 1.0 is ancient!
It wouldn't hurt to download a whole new version of Firefox, currently at version 1.5.0.7 !
- to find that the new Ffox works a whole lot better than any of the 1.0 versions..

PenguinOpus

unread,
Sep 23, 2006, 3:39:28 PM9/23/06
to KML Discussions

Which link on the Google earth.google.com page gave you text/html? I just tried the Transamerica.kmz and got the correct mimetype. Be sure to scroll back and look at the 200 or 304 response that you get. There's lots of other http transactions that seem to occur in sympathy with any download.
Reply all
Reply to author
Forward
0 new messages