'video/x-ms-wmv', '.qt' => 'video/quicktime', '.mov' => 'video/quicktime', '.avi' => 'video/x-msvideo', ); $ctype = @$map[$m[1]]; } if (!$ctype) $ctype = 'application/octet-stream'; 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=".basename($filename).";" ); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".@filesize($filename)); @readfile("$filename") or die("file not found."); exit; ?>