public function down_template()
{
$file = PUBLIC_DIR.'/门店导入模板.xls';
header('Content-Disposition: attachment; filename=门店导入模板.xls');
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Length: '.filesize($file));
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate');
header('Pragma: public');
readfile($file);
exit;
}
PHP readfile实现文件下载
最新推荐文章于 2024-04-14 05:15:00 发布