php下载文件,添加响应头

//下载,添加响应头信息
header('Content-type:application/octet-stream');
header('Content-Disposition:attachment;filename="'.basename($file).'"');
header('Content-Length:'.filesize($file));
readfile($file);

posted @ 2016-09-10 15:54  D蓝叶  阅读(1040)  评论(0编辑  收藏  举报