codice:
header ("Pragma: no-cache");
header ("Expires: 0");
header ("Cache-Control: no-cache, no-store, must-revalidate, post-check=0, pre-check=0");
header ("Content-type: application/octect-stream");
header ("Content-Disposition: attachment; filename=$file");
header ("Content-Length: ".filesize("$path/$file"));
$fp=fopen("$path/$file","rb");
while (!feof($fp))
print fread($fp,8192);
fclose($fp);
// qui aggiorni il contatore. se il download è interrotto durante il while non dovrebbe avere effetto...