Jump to content

force download audio file


ted_chou12

Recommended Posts

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

Link to comment
Share on other sites

# 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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.