一般來(lái)說(shuō),下載txt會(huì)直接打開,把下面的代碼放入到下載頁(yè)面中,就提示下載并可以進(jìn)度保存了!文件位置(eDownSysclassDownSysFun.php)
找到如下代碼(帝國(guó)CMS7.5 大概203行左右)
//下載
Header("Content-type: application/octet-stream");
//Header("Accept-Ranges: bytes");
//Header("Accept-Length: ".$filesize);
Header("Content-Disposition: attachment; filename=".$filename);
echo ReadFiletext($file);
改成如下代碼:(注意UTF8編碼請(qǐng)用編輯器打開修改) //下載 $filesize = filesize($file); Header('Pragma: public'); Header('Last-Modified:'.gmdate('D, d M Y H:i:s') . ' GMT'); Header('Cache-Control: no-store, no-cache, must-revalidate'); Header('Cache-Control: pre-check=0, post-check=0, max-age=0'); Header('Content-Transfer-Encoding: binary'); Header('Content-Encoding: none'); Header("Content-type: application/octet-stream"); Header("Content-Disposition: attachment; filename=".$filename); Header('Content-length: '.$filesize); echo ReadFile($file);
版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: 帝國(guó)CMS強(qiáng)制下載txt文件瀏覽器帶下載進(jìn)度顯示