[英]Download csv file not working on server
您好需要下載生成的csv文件,但我在下面的代碼中使用了該文件,但是在服務器上,我無法下載csv文件。 相同的代碼在我的本地系統中工作正常,但在實時服務器上不工作。
<?php
function downloadFile($filename,$filepath)
{
header("Content-type: text/csv"); // instead of pdf use others... for text
header("Content-disposition: attachment; filename=".$filename);
readfile($filepath);
}
?>
檢查您的服務器,可能存在空間限制。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.