2007年

IE で CSV がダウンロードできない問題 このエントリーを含むはてなブックマーク

Windows, その他 Add comments

OpenPNE の管理画面からメンバー情報を CSV ファイルとしてダウンロードする機能があります。その CSV ダウンロードが IE6 でエラーになってダウンロードできない問題がありました。

原因はマイクロソフトのサイト Content-Disposition: attachemnt と Cache-Control: no-cache によるダウンロードの問題 に書かれていました。

対処方法として、
webapp/modules/admin/do/csv_member.php を webapp_ext/modules/admin/do/csv_member.php にコピーして

header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=member.csv");

となっているところを下記のように修正します。

header("Pragma: public");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=member.csv");

これでダウンロードができるようになります。

なお、Content-Disposition: attachemnt と Cache-Control: no-cache によるダウンロードの問題 では現象が発生するブラウザとして

•Microsoft Internet Explorer 5.0
•Microsoft Internet Explorer 6.0
•Microsoft Internet Explorer 6.0 Service Pack 1

と書かれていましたが、 IE6 の SP2 でも同様の現象が発生しました。

関連する投稿

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS ログイン