我正在尝试为我的 KMZ 文件创建下载。这适用于 Firefox 和 Chrome,但不适用于 IE(9、10 或 11)。这是我的代码:
function kmz_export($result){
header_remove();
// .... create file
$zip = new ZipFile();
$zip->addFile($kml, $title . '.kml');
header('Content-Type: "application/vnd.google-earth.kmz+xml"');
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=". $title .".kmz");
header("Content-Transfer-Encoding: binary");
echo $zip->file();
exit();
}
另一方面,如果我将内容类型更改为 applicaiton/PDF 并将标题更改为 .PDF,则下载正常(但无法打开,因为它不是真正的 pdf 文件)。任何帮助都会很棒!
谢谢杰森