Does the user have a login? if you donโt just use sessions or even better track their ip address.
Here is an example session:
$_SESSION['file_downloading']==true;
$file = fopen($local_file, "r");
while(!feof($file))
{
print fread($file, round($download_rate * 1024));
flush();
sleep(1);
}
$_SESSION['file_downloading']=null;
fclose($file);}
Then, first of all, this code,
if(!empty($_SESSION['file_downloading']))
// - .
- ip-.
function VisitorIP()
{
if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
$TheIp=$_SERVER['HTTP_X_FORWARDED_FOR'];
else $TheIp=$_SERVER['REMOTE_ADDR'];
return trim($TheIp);
}
IP- , . ip-, . ?