PHP下载图片、文件
【摘要】PHP实现图片的下载
- $url = “/images/6.jpg"
- $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($url).'"');
- header('Content-Transfer-Encoding: binary');
- header('Connection: close');
- readfile($url); // push it out
版权归 马富天PHP博客 所有
本文标题:《PHP下载图片、文件》
本文链接地址:http://www.mafutian.net/17.html
转载请务必注明出处,小生将不胜感激,谢谢! 喜欢本文或觉得本文对您有帮助,请分享给您的朋友 ^_^