Ezekiel !
Elite
Puis-je limiter la bande passante d'un repertoire via un htaccess ou un script?
c97 at c97 dot art dot pl
20-Nov-2002 06:02
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);
}
?>
soit il redirige ou mieux c ton script qui 'lit' et envoye le fichier ...Azura a dit:Ah j'avais mal compris. Pour ca je pense qu'il faut passer par un système de redirection, genre tu appel download.php et il redirige vers un fichier tout en comptabilisant le nombre de téléchargements.
lol po complié tu c en fait ...Ez3kieL a dit:c'est ce que je me disais aussi mais j'espérais trouver un tit script dja tout fais...