gpt4 book ai didi

php - 无法加载资源 : Frame load interrupted - Agian

转载 作者:可可西里 更新时间:2023-11-01 12:38:54 24 4
gpt4 key购买 nike

我有从虚假链接下载图片的代码。我看过其他评论/网站,但没有任何帮助我找到解决烦人的方法:

“加载资源失败:框架加载中断”

我的 php header 是在我读取 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);

并且我有调用 iframe 来下载文件的 jQuery 脚本:

$('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, post-check=0, 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');

这会起作用 ;-)

关于php - 无法加载资源 : Frame load interrupted - Agian,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12359600/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com