-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
Description
windows10+Edgeで日本語名ファイルをダウンロードすると、ファイル名が文字化けします。
下記で対応しました。
ご報告まで。
HTTP_USER_AGENT (windows10+Edge)
HTTP_USER_AGENT
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586
修正前
/html/webapp/components/uploads/View.class.php
| header("Content-disposition: inline; filename=\"".$filename."\""); |
修正後
} else {
// 上記以外(Mozilla, NetScape, GoogleChrome, Edge)
//header("Content-disposition: inline; filename=\"".$filename."\"");
header('Content-Disposition: attachment; filename*=UTF-8\'\''.rawurlencode($filename));
}動作確認
- windows10
- Chrome 日本語ファイル名ダウンロードok
- Edge 日本語ファイル名ダウンロードok
- FireFox ok
- IE11 ok
参考URL
▼ PHPでダウンロードさせるファイル名がIEで文字化けする件 - Qiita
http://qiita.com/takehironet/items/79c025e4140e29c57abe
⇒ IEと書いてあるけどEdgeにも有効だった
Reactions are currently unavailable