艾若薇雅 :: 技術文章

Xoops 沒告訴你的事 --- IE 點 CBB 附件會出現檔名錯誤問題


在 unicode 編碼的 CBB 下, 若有使用者上傳文章的檔名是中文字, 或者有 空格交雜...
[歡迎你轉載本文章, 但請必需註明出處: http://www.elevior.com]

在 unicode 編碼的 CBB 下, 若有使用者上傳文章的檔名是中文字, 或者有 空格 交雜
你是不是也發現了有底下這種問題呢?用 FireFox 下載檔案時很正常, 但用 IE 下載檔案時卻是以下畫面
那麼, 要怎麼解決這種問題? 很簡單, 作法如下:到你的 newbb 目錄下, 找到你的 dl_attachment.php
if (preg_match("/MSIE ([0-9]\.[0-9]{1,2})/", $_SERVER["HTTP_USER_AGENT"])) {
              
// 瀏覽器是 IE 的話 // avex modified, unicode 檔名 問題     header('Content-Disposition: attachment; filename="' . urlencode($file_display) . '"'); 
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
} else { // 其它瀏覽器 header('Content-Disposition: attachment; filename="' . $file_display . '"');     header('Pragma: no-cache');
}

添加 urlencode 即可解決 unicode 編碼 IE6 無法接受的問題, 別忘了要加註解以免日後忘了
 另外,其它非 CBB 也是用這種方法去解
艾維斯 2009/02/22
<< Xoops 沒告訴你的事 --- 如何讓 CBB 可以 upload 新類型檔案 The way to fix Description Field not shown in VideoTube module >>

跟蹤網址
  • 文章地址: http://www.elevior.com/modules/article/view.article.php/c2/10
  • 跟蹤地址: http://www.elevior.com/modules/article/trackback.php/10
API: RSS | RDF | ATOM
Copyright© avex & 艾若薇雅
網友個人意見,不代表本站立場。對於發言內容,由發表者自負責任。

發表者 樹狀展開
linhail87
發表日期: 06月19日 16:18  更新: 06月19日 16:18
新會員
註冊日期: 06月19日
來自:
發表總數: 14
 評論: Xoops 沒告訴你的事 --- IE 點 CBB 附件會出...
If you wow power leveling were one of the users who was concerned about profile privacy issues, please go to your user wow power leveling page and double-check your private character status!
We made an internal fix and unfortunately we had wow gold to wipe part of the data which determined which profiles were private and which were aion power leveling not.
All good now, but unfortunately you MAY have to re-flag your profiles aion gold as private. Just use the "User Page" link in the cheap wow power leveling top right to go to your list of characters buy wow power leveling and profiles, select the checkbox, and click cheap wow gold "Make Private".