Hidden downloads with PHP
Code to push downloads with custom name. Requires the fileinfo extension for the
mime_content_type
function..PHP
$file = './files/'. $f; header('Content-Description: File Transfer'); header('Connection: Keep-Alive'); header("Cache-control: must-revalidate, post-check=0, pre-check=0"); header("Content-length: ". filesize($file)); header("Content-type: ". mime_content_type($file)); header("Content-disposition: attachment; filename=".$f.";"); set_time_limit(0); while (ob_get_level()) ob_end_clean(); exit(readfile($file));