So, I have a script that works downloading a file - excerpt below:
header("Pragma: public");
header("Expires: 0");
header('Content-type: "application/octet-stream"');
header("Cache-Control: private",false);
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
$f = "Content-Disposition: attachment; filename=\"".$myfile['downloadname'].".".$myfile['ext']."\"";
header($f);
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($file));
ob_clean();
flush();
readfile("$file");
exit();
I record elsewhere in a mysql database when the script is started.
In addition, I'd like to be able to record whether the download completes (successfully or otherwise).
As it is, the script can run and the user press cancel and it looks like a download but isn't.
Is this possible? If so, how?
Your help, as ever, gratefully received.