$dist_allowed) die("Sorry, you are not authorized to access this page."); header('Content-Description: File Transfer'); header('Content-Type: application/zip'); header('Content-Disposition: attachment; filename=' . basename($file)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); ob_clean(); flush(); readfile( $file ); exit; // Note that if you want your file to be viewed in a browser rather than downloaded simply modify line 8 use to use "Content-Disposition: inline; ..." ?>