ted_chou12 Posted March 27, 2011 Share Posted March 27, 2011 Hi, I want to force download an asf (audio) file, i have found a script, but it is not for asf but pdf, i was searching for mime types, but not sure what asf classifies? <?php // your file to upload $file = '2007_SalaryReport.pdf'; header("Expires: 0"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Content-type: application/pdf"); // tell file size header('Content-length: '.filesize($file)); // set file name header('Content-disposition: attachment; filename='.basename($file)); readfile($file); // Exit script. So that no useless data is output-ed. exit; ?> i found this page http://www.utoronto.ca/web/htmldocs/book/book-3ed/appb/mimetype.html#audi so sould it be audio/x-wav? Thanks, Ted Quote Link to comment https://forums.phpfreaks.com/topic/231823-force-download-audio-file/ Share on other sites More sharing options...
dreamwest Posted March 27, 2011 Share Posted March 27, 2011 # instruct browser to download multimedia files AddType application/octet-stream .avi AddType application/octet-stream .mpg AddType application/octet-stream .wmv AddType application/octet-stream .mp4 AddType application/octet-stream .mov AddType application/octet-stream .3gp AddType application/octet-stream .zip Quote Link to comment https://forums.phpfreaks.com/topic/231823-force-download-audio-file/#findComment-1192779 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.