PHPでPDFをダウンロードさせようとしたところ、
Internet Explorer では、・・・をダウンロードできません。 このインターネットのサイトを開くことができませんでした。要求されたサイトが使用できないか、見つけることができません。後でやり直してください。
て、メッセージが出た。
で調べたところ、WindowsXP + IE8以前 + SSL の場合に起きるようで、
出力する時のHeader情報に問題があったよう。
これまでは、
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename="'.basename($name).'"');
だけだったのだけども、
header('Content-Description: File Transfer');
header('Cache-Control: private, must-revalidate, post-check=0, pre-check=0, max-age=1');
header('Pragma: public');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Content-Type: application/force-download');
header('Content-Type: application/octet-stream', false);
header('Content-Type: application/download', false);
header('Content-Type: application/pdf', false);
header('Content-Disposition: attachment; filename="'.basename($name).'"');
header('Content-Transfer-Encoding: binary');
全て必要かどうかは未確認だけども、これで解決。
今までが少な過ぎたね・・・。
This website uses cookies.