完整的文件下载或导出头信息。
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: ‘.$filetype);//文件类型
header(‘Content-Disposition: attachment; filename=”‘.$filename.'”‘);//文件名称
header(‘Content-length: ‘.$filesize);//文件大小

内容摘自:http://blog.csdn.net/fafa211/article/details/5801371

Related Posts: PHP-防盗链输出下载文件header控制-计算下载进度 :