2

I am trying to create a download for my KMZ file. This works fine in both Firefox and Chrome but not IE (9, 10, or 11). Here is my code:

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();  

}

On the other hand, if I change the content type to applicaiton/PDF and the title to .PDF, it downloads fine (but cant be opened as its not really a pdf file). Any help would be greate!

thanks jason

jason
  • 3,821
  • 10
  • 63
  • 120

1 Answers1

0

I got some similar but not the same issue about downloading kmz file. Your issues happened in different browser and my issues happened in different PC. I got my issue fixed. I don't believe it is the solution to your issue. But, you may want to take a look. Maybe you can try to remove the line for Content-Disposition in your code and give it a try. Then, maybe, you may got some feeling for you issue. Please see the detail of my issue and solution here: https://stackoverflow.com/questions/33442797/download-file-as-do-in-some-pc-response-setheadercontent-type-appli

Hope this help.

Community
  • 1
  • 1