php通过修改header强制图片下载的代码 2019年9月9日 04:22:51php教程评论602 views阅读模式 unction downloadFile($file){ $file_name = $file; $mime = 'application/force-download'; header('Pragma: public'); // required header('Expires: 0'); // no cache header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: private',false); header('Content-Type: '.$mime); header('Content-Disposition: attachment; filename="'.basename($file_name).'"'); header('Content-Transfer-Encoding: binary'); header('Connection: close'); 复制代码 点赞 登录收藏 https://www.qieseo.com/315653.html 复制链接 复制链接