Header Directives in IE7

I’ve written a PHP application for work. And there is one feature where you can export all data you’ve entered in input boxes and textareas into one PDF file with one click. To create that very PDF file I use ezPDF.

And to get that PDF file in Firefox, Safari and whatosever it is sufficient to output two header directives:

<?php
// $pdfcode is some pdf file
header(‘Content-type: application/pdf’);
header(‘Content-Disposition: attachment; filename=filename.pdf’);
echo $pdfcode
?>

In IE7 you need to do more than that to recieve the same result:

<?php
// $pdfcode is some pdf file
header(“Cache-Control: public”);
header(“Content-Description: File Transfer”);
header(‘Content-Type: application/pdf’);
header(‘Content-Disposition: attachment; filename=filename.pdf’);
header(“Content-Type: application/pdf”);
header(“Content-Transfer-Encoding: binary”);
echo $pdfcode
?>

Hope this helps anyone!

Ähnliche Einträge

About maze