/ Published in: PHP
This snippet shows you how to limit the download rate of a file download.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// 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; // send headers // flush content // open file stream // send the current file part to the browser // flush the content to the browser // sleep one second } // close file stream else { }
URL: http://jonasjohn.de/snippets/php/dl-speed-limit.htm