下載我有PHP的問題,我試圖迫使文件下載使用PHP強制使用PHP
如果我的用戶點擊鏈接www.site.com/download.php它重定向他們的download.php在download.php文件中使用以下代碼
header('Content-Type: application/csv');
header('Content-Disposition: attachment; filename=custom_report.csv');
header('Pragma: no-cache');
echo readfile('files/csv/custom_report.csv');
但是,爲了安全起見,在服務器上禁用了readfile和fopen。
有沒有其他辦法,我可以做到這一點
你確定他們不僅僅是禁用遠程訪問,如http:// ...? – 2010-01-07 15:05:51
我也試過這樣做Download Report (csv file format)仍然失敗 – Roland 2010-01-07 15:08:31