0
我正在使用以下代码通过下载链接控制带宽使用情况。下面是我与实施QOS Bandwidth Throttle PHPQoS带宽限制不起作用
// create new config
$config = new ThrottleConfig();
// enable burst rate for 30 seconds
$config->burstTimeout = 30;
// set burst transfer rate to 50000 bytes/second
$config->burstLimit = 10000;
// set standard transfer rate to 15.000 bytes/second (after initial 30 seconds of burst rate)
$config->rateLimit = 15000;
// enable module (this is a default value)
$config->enabled = true;
// start throttling
$x = new Throttle($config);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-type: application/zip");
header("Content-Disposition: attachment; filename=\"".$zipname."\"");
header("Content-Transfer-Encoding: binary");
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=\"".$zipname."\"");
header("Content-Length: ".filesize($directory_location . '/' . $zipname));
我收到损坏的文件,没有实际大小(4MB),我也得到近似(2KB)尺寸使用的代码。如果我使用readfile()
功能,那么我没有发现油门类readfile()
:(
谁能告诉我的工作,有什么错了,我在这里做
嗯,到底发生了什么? –
@Pekka웃对不起,我忘了提到确切的问题,我已经更新了问题底部的问题。 –
Lo确定在文件中。它包含什么? –