The solution would be to make the link the very goal of the PHP script.
You would hide the actual file somewhere inaccessible from the browser (i.e. where you can get to the file via fopen() , but not at the root of the document) and place the download.php file to upload the files.
The loading script will look something like this:
$fileid = $_REQUEST['file']; $file = file_location($fileid);
Any link you point to just points to download.php? fileid = 712984 (no matter what the file actually is). This will be the actual download link, as the script transfers the file; but only if the user is allowed to receive it. You will have to write the functions file_location() , check_permissions_for() and mark_downloaded() .
aaaaaa123456789
source share