I have a program on a site. I want to count the number of downloads so the downloadlink performs some sql and then this:
$file = "VisualCron_NET.exe";
$download_size = filesize($file);
header("Content-type: application/x-download");
header("Content-Disposition: attachment; filename=$file;");
header("Accept-Ranges: bytes");
header("Content-Length: $download_size");
@readfile($file);
For some users this results in broken downloads at early stages (maybe after 400kb or 1000kb).
Can I do this a better way? Or why does this happen?
thanks / Henrik