
21.07.2009, 18:07
|
|
Крёстный отец :)
Регистрация: 22.06.2005
Сообщений: 1,330
С нами:
10991846
Репутация:
2054
|
|
может кому пригодится часть кода, взято с обменника.
PHP код:
<?php
*******
$filename = "./uploads/".$file;
// set the download rate limit
$download_rate = 150;
// set the download rate limit (premium)
// $download_rate = 5000;
// send headers
header("Content-Type: application/unknown");
header("Content-type: application/octet-stream"); // FireFox
header("Content-type: application/octetstream"); // IE
header("Content-Disposition: inline; filename=". str_replace(" ", "_", $file));
header('Content-length: ' . (string)(filesize($filename)));
// flush content
flush();
// open file stream
$f = fopen($filename, "r");
while(!feof($f)) {
// send the current file part to the browser
print fread($f, round($download_rate * 1024));
// flush the content to the browser
flush();
// sleep one second
sleep(1);
}
// close file stream
fclose($f);
*****
?>
__________________
Лучший способ защиты - это нападение!!!
|
|
|