我想做一个PHP文件下载页download.php。用到下面代码,有什么问题吗?为什么下载的文件都打不开。那位高手能挨行解释一下。困扰了很久一头雾水啊。$themes['file']为文件路径(包含文件名)。header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=\"".basename($themes['file'])."\";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".@filesize($themes['file']));
set_time_limit(0);
@readfile($themes['file']) or die("File not found.");我该怎么解决呢?给个提示也行。先谢了
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=\"".basename($themes['file'])."\";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".@filesize($themes['file']));
set_time_limit(0);
@readfile($themes['file']) or die("File not found.");我该怎么解决呢?给个提示也行。先谢了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货