解決dotproject中文名文件下載亂碼問題的解決方法
更新時間:2008年11月13日 20:49:01 作者:
汗一個,老解決問題,這我快成dotproject的中文技術(shù)支持了……,沒法,問題還需要解決。
【問題】
文件管理,上傳中文文件名的文件,下載時候文件名出現(xiàn)亂碼。
【解決】
還是編碼問題,需要轉(zhuǎn)碼。
打開根目錄下的fileviewer.php文件,找到一下代碼:
<?php
……
header('MIME-Version: 1.0');
header( 'Pragma: ');
header( 'Cache-Control: public');
header( 'Content-length: '.$file['file_size'] );
header( 'Content-type: '.$file['file_type'] );
header( 'Content-transfer-encoding: 8bit');
header( 'Content-disposition: attachment; filename="'.$file['file_name'].'"' );
……
修改為:
<?php
……
header('MIME-Version: 1.0');
header( 'Pragma: ');
header( 'Cache-Control: public');
header( 'Content-length: '.$file['file_size'] );
header( 'Content-type: '.$file['file_type'] );
header( 'Content-transfer-encoding: 8bit');
header( 'Content-disposition: attachment; filename="'.iconv("UTF-8","gb2312",$file['file_name']).'"' );
……
文件管理,上傳中文文件名的文件,下載時候文件名出現(xiàn)亂碼。
【解決】
還是編碼問題,需要轉(zhuǎn)碼。
打開根目錄下的fileviewer.php文件,找到一下代碼:
復制代碼 代碼如下:
<?php
……
header('MIME-Version: 1.0');
header( 'Pragma: ');
header( 'Cache-Control: public');
header( 'Content-length: '.$file['file_size'] );
header( 'Content-type: '.$file['file_type'] );
header( 'Content-transfer-encoding: 8bit');
header( 'Content-disposition: attachment; filename="'.$file['file_name'].'"' );
……
修改為:
復制代碼 代碼如下:
<?php
……
header('MIME-Version: 1.0');
header( 'Pragma: ');
header( 'Cache-Control: public');
header( 'Content-length: '.$file['file_size'] );
header( 'Content-type: '.$file['file_type'] );
header( 'Content-transfer-encoding: 8bit');
header( 'Content-disposition: attachment; filename="'.iconv("UTF-8","gb2312",$file['file_name']).'"' );
……
相關(guān)文章
phpcms數(shù)據(jù)表結(jié)構(gòu)和字段詳細說明
PHPCMS?V9可以輕松承載百萬級的訪問數(shù)據(jù),最大的功臣就是PHPCMS良好的數(shù)據(jù)庫結(jié)構(gòu)。學習一下PHPCMS的數(shù)據(jù)庫結(jié)構(gòu)。數(shù)據(jù)表的默認表前綴是V9_?,表前綴的主要作用是數(shù)據(jù)庫中有不同系統(tǒng)的數(shù)據(jù)表存在時,可以用表前綴來區(qū)分出來。2023-04-04zblogphp使用GetArticleList、GetList函數(shù)調(diào)用熱門文章列表
ZBLOG?PHP文章的時候會用到最新文章、點擊數(shù)、評論數(shù)文章調(diào)用,在Zblog?php?1.7版本以前使用GetArticleList函數(shù),但之后,GetList函數(shù)增加where_custom、order_custom等多個重要參數(shù),從而可以輕易地調(diào)用熱門文章、熱評文章或隨機文章等列表了。2022-12-12zblogphp、Z-Blog PHP數(shù)據(jù)庫結(jié)構(gòu)及表中的字段詳細說明
如果你是一位開發(fā)者,你一定知道Zblog-PHP。它是一款非常流行的開源博客系統(tǒng),許多人使用它來創(chuàng)建自己的博客。在使用Zblog-PHP的過程中,你可能會遇到一些數(shù)據(jù)庫字段,這些字段可能會導致一些困惑。因此,在本文中,我們將詳細解釋Zblog-PHP數(shù)據(jù)庫字段的含義和作用。2023-03-03fastAdmin表單驗證validate的錯誤提示信息,如何改變位置?
fastAdmin表單驗證validate的錯誤提示,默認是在右側(cè)的n-right,如果放在右側(cè)不太好看,想調(diào)整到其他位置,該怎么操作呢?2023-08-08wordpress?12個數(shù)據(jù)表結(jié)構(gòu)和字段說明
WordPress安裝的時候數(shù)據(jù)庫會有12個默認的數(shù)據(jù)表,每張表的數(shù)據(jù)都包含了?WordPress?不同的功能??纯催@些表的結(jié)構(gòu),你能很容易的了解網(wǎng)站不同的部分都是存在哪里的。這篇文章主要介紹了wordpress?12個數(shù)據(jù)表結(jié)構(gòu)和字段說明,需要的朋友可以參考下2023-04-04