下载文件(execl,img 等)

$data_path = '路径';

header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename = 经销商绩效管理批量导入模板.xls');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($data_path));
readfile($data_path);
posted @ 2017-09-13 19:49  太空刘  阅读(220)  评论(0编辑  收藏  举报