How to make temporary expiring link for a downloadable file
Option 1: You can achieve this using htaccess if you have single download file/path. But if you have more files available for download. Creating a temporary file for each download requests and using htaccess is not a good idea. $path=”uploads/”; $actualfilename=$path.$filename; $fakefilename=”downloadfile.pdf”; if($typeofview==”download”) { @readfile($actualfilename); header(‘Content-type: application/pdf’); header(‘Content-Disposition: attachment; filename=”‘ . $fakefilename . ‘”‘); header(‘Content-Transfer-Encoding: … Read more