I have made a script just to test out fread function and used this example from php.net
Simple script to limit browser download speed using fread function.
<?php
$file = "test.mp3"; // file to be send to the client
$speed = 8.5; // 8,5 kb/s download rate limit
if(file_exists($file) && is_file($file)) {
header("Cache-control: private");
header("Content-Type: application/octet-stream");
header("Content-Length: ".filesize($file));
header("Content-Disposition: filename=$file" . "%20");
flush();
$fd = fopen($file, "r");
while(!feof($fd)) {
echo fread($fd, round($speed*1024));
flush();
sleep(1);
}
fclose ($fd);
}
?>
The problem is i tried running two or three executions of the script but i can just get a max of 2 executions.. when one file finihes download then the third page shows up otherwsie it just waits. Is this a problem with my IE or PHP ?
Thank You