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
https://forums.phpfreaks.com/topic/231823-force-download-audio-file/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.