首页 > 应用开发 > IT综合 > 实现.KML和.KMZ 文件的下载
我们可以通过下面这个链接,了解到解决的方法:
http://earth.google.com/kml/kml_tut.html
......
Google Earth reads KML and KMZ files. The MIME type for KML files is
application/vnd.google-earth.kml+xml
The MIME type for KMZ files is
application/vnd.google-earth.kmz
For Apache, add these lines to the httpd.conf file:
AddType application/vnd.google-earth.kml+xml .kml
AddType application/vnd.google-earth.kmz .kmz
......
■Windows WEB服务器:
追加IIS的MIME映射的文件种类。
■TOMCAT之类的WEB服务器:
除了需要在代码中追加response.setContentType("application/vnd.google-earth.kmz");
还需要在WEB.XML里追加.KML,.KMZ附件的定义:
■附录
MIME类型的定义:
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/174388/viewspace-913207/ ,如需转载,请注明出处,否则将追究法律责任。