php实现下载限制速度示例分享 |
本文标签:php,下载限制 复制代码 代码如下: // local file that should be send to the client $local_file = test-file.zip; // filename that the user gets as default // set the download rate limit (=> 20,5 kb/s) if(file_exists($local_file) && is_file($local_file)) { // send headers // flush content // open file stream while (!feof($file)) { // send the current file part to the browser // flush the content to the browser // sleep one second // close file stream } else { |