0

错误

如上图所示,我在尝试通过 IDM 从我的站点下载文件时遇到此错误。限制仅在输入验证码后才请求该页面一次,并且如果您再次请求该页面必须再次输入验证码。

这种情况下如何支持IDM

下载代码如下

$file='test.mp3';
$download_rate = 50; //50 kb/s

if(file_exists($file) && is_file($file))
{
    header('缓存控制:私有');
    header('Content-Type: application/octet-stream');
    header('内容长度:'.filesize($file));
    header('Content-Disposition: filename='.$file);

    冲洗();
    $file = fopen($file, "r");

    而(!feof($文件))
    {
        // 将当前文件部分发送到浏览器
        打印 fread($file, round($download_rate * 1024));
        // 刷新内容到浏览器
        冲洗();
        // 休眠一秒
        睡眠(1);
    }
    fclose($文件);
    }
别的 {
    echo '找不到文件';
}
4

1 回答 1

0

使用 xsendfile。一个阿帕奇的模组

https://tn123.org/mod_xsendfile/

于 2011-04-01T22:37:04.143 回答