ERROR: download file NOT SPECIFIED. USE download.php?file=filepath"; exit; } elseif ( ! file_exists( $filename ) ) { echo "ERROR: File not found. USE download.php?file=filepath"; exit; }; switch( $file_extension ) { case "mov": $ctype="video/quicktime"; break; case "mp4": $ctype="video/mp4"; break; default: $ctype="application/force-download"; } header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); // required for certain browsers header("Content-Type: $ctype"); header("Content-Disposition: attachment; filename=\"".$filename."\";" ); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($filename)); readfile("$filename"); exit(); ?>