/ Published in: PHP
                    
                                        
                            
                                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://www.jonasjohn.de/snippets/php/dl-speed-limit.htm
Comments
 Subscribe to comments
                    Subscribe to comments
                
                