download

[insert_php]

if(!empty($_GET[‘file’])){
$fileName = basename($_GET[‘file’]);
$filePath = ‘Upload/’.$fileName;
if(!empty($fileName) && file_exists($filePath)){
// Define headers
header(« Cache-Control: public »);
header(« Content-Description: File Transfer »);
header(« Content-Disposition: attachment; filename=$fileName »);
header(« Content-Type: application/zip »);
header(« Content-Transfer-Encoding: binary »);
header(« Content-Type: application/pdf »);
// Read the file
readfile($filePath);
exit;
}else{
echo ‘The file does not exist.’;
}
}
[/insert_php]