四虎精品视频-四虎精品成人免费网站-四虎黄色网-四虎国产视频-国产免费91-国产蜜臀97一区二区三区

php實現下載限制速度示例分享

復制代碼 代碼如下:
// local file that should be send to the client
$local_file = 'test-file.zip';

// filename that the user gets as default
$download_file = 'your-download-name.zip';

// set the download rate limit (=> 20,5 kb/s)
$download_rate = 20.5;

if(file_exists($local_file) && is_file($local_file)) {

 // send headers
 header('Cache-control: private');
 header('Content-Type: application/octet-stream');
 header('Content-Length: '.filesize($local_file));
 header('Content-Disposition: filename='.$download_file);

 // flush content
 flush();

 // open file stream
 $file = fopen($local_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);
 }

 // close file stream
 fclose($file);

}

else {
 die('Error: The file '.$local_file.' does not exist!');
}

php技術php實現下載限制速度示例分享,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: silk铃木一彻| 汤晶锦| 小小少年电影简介| 许慧强| 在线观看xx| 菊地亚美| 真实游戏完整版高清观看| 电影《斯大林格勒》| 冬春之交电影| 赵健的读书日记| 叶子楣代表咋| 我的新学校英语作文| 黎明电影| 45分钟见奶薄纱透明时装秀| 维拉·法梅加| 髋关节置换术后护理ppt| 情侣不雅视频| 宇辉| 铁血使命演员表全部| 山口小夜子| 小数除法竖式50道带答案| 1988年英国的白蛇传说| 康熙微服私访记1| 郭馨钰| 郑艳丽曹查理主演的影片| 假面骑士响鬼| 圆的认识评课| 小腿垫东西睡觉正确图| 大开眼戒在线观看| 麻烦是朋友| 38在线电影| justin harris| 焕羽电视剧免费播放在线观看| 蜘蛛侠4英雄无归| 抖 音 下载安装| 摇曳庄的幽奈小姐| 防冲撞应急处置预案| 欠条怎么写才具有法律效力| 庆余年2豆瓣| 实验室火灾报警电铃响时应当| 成毅壁纸|