加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 无法加载资源:帧加载中断 – Agian

发布时间:2020-12-13 13:06:30 所属栏目:PHP教程 来源:网络整理
导读:我有从虚假链接下载图片的代码.我看过其他评论/网站,但没有任何帮助我找到烦人的解决方案: “无法加载资源:帧加载中断” 我的php标题是在我读取GET值之后: header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: private"
我有从虚假链接下载图片的代码.我看过其他评论/网站,但没有任何帮助我找到烦人的解决方案:

“无法加载资源:帧加载中断”

我的php标题是在我读取GET值之后:

header("Pragma: public"); // required 
header("Expires: 0"); 
header("Cache-Control: private",false); // required for certain browsers 
//header('Content-Length: '. @filesize($id));
header('Content-Type: '.$mim);
header('Content-Disposition: attachment; filename="'.$date.basename($fileName).'"');
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate,post-check=0,pre-check=0');
readfile($fileName);

我有jQuery脚本调用iframe下载文件:

$('body').append('<iframe class="download" src="download.php?id='+downloading+'" style="visibility:hidden;" width="0" height="0"></iframe>');

我正确下载文件,但在控制台显示错误,请告诉我它是否可修复?

header("Pragma: public"); // required
header("Expires: 0"); 
header("Cache-Control: must-revalidate,pre-check=0"); 
header("Cache-Control: private",false); // required for certain browsers 
header("Content-type: application/x-unknown"); // I always use this
header("Content-Disposition: attachment; filename='theFilename.ext'");
header("Content-Transfer-Encoding: binary");
header("Content-Length: 177998"); // you might want to set this
readfile('/the/url/to/theFilename.ext');

这将工作;-)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读