$url='http://apply.com/static/upload/head/20190711/d612d32ac92be41a64ffb091fad01508.png';
$file_name = time().'.png'; //保存的图片名称
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$file_name);
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($url));
ob_clean();
flush();
readfile($url);
exit;
a标签点击图片链接下载到本地
已有 3 条评论
这是一篇佳作,无论是从内容、语言还是结构上,都堪称完美。
作者的观点新颖且实用,让人在阅读中获得了新的思考和灵感。
以终为始的思考方式为行业指明方向。