I have a page with links on it for files to download. The link points to a page called dl.php which contains the following code:
$file = "manuals/".$_POST['file'];
header('Content-Description: File Transfer');
header('Content-Type: application/pdf');
header('Content-Length: ' . filesize($file));
// to download
header('Content-Disposition: attachment; filename=' . basename($file));
// to open in browser
//header('Content-Disposition: inline; filename=' . basename($file));
readfile($file);
For the most part everything is fine. But I notice that people with slower internet connections often have a hard time downloading the file simply because some files are very large.
So I thought of having a Lite Download Manager that they could install and use. But I noticed that download manager try and download the page dl.php instead of the actual file. How do I work around this.
I cannot have them access the file directly as some of the information is confidential. I really need to monitor the downloads.
Thanks in advance