如何在不允许请求页面的情况下支持IDM两次

正如上图所示,当我试图通过IDM从我的网站上下载一个文件时,我得到了这个错误。 只有输入验证码后才能请求该页面一次的限制,如果您再次请求该页面,则必须再次输入验证码。
在这种情况下如何支持IDM
下载代码如下
$file='test.mp3';
$download_rate = 50; //50 kb/s
if(file_exists($file) && is_file($file))
{
header('Cache-control: private');
header('Content-Type: application/octet-stream');
header('Content-Length: '.filesize($file));
header('Content-Disposition: filename='.$file);
flush();
$file = fopen($file, "r");
while(!feof($file))
{
// send the current file part to the browser
print fread($file, round($download_rate * 1024));
// flush the content to the browser
flush();
// sleep one second
sleep(1);
}
fclose($file);
}
else {
echo 'File Not Found';
}
使用xsendfile。 apache的mod
https://tn123.org/mod_xsendfile/
链接地址: http://www.djcxy.com/p/45513.html上一篇: How to support IDM without allow request the page two times
下一篇: Unable to browse the site while downloading a file using php
