Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

about downloading mp3 file

  • 4 个回答
  • 1 人有此问题
  • 9 次查看
  • 最后回复者为 rambo12

more options

i have a php site. i am able to download mp3 files on localhost. after uploading on hosting server, i am able to download on IE, chrome. but mozilla gives a garbage file. instead of music file. I disabled vlc plugin or windows plugin and checked, still not working. Please help. In code i have given header('Content-Type: application/force-download)

i have a php site. i am able to download mp3 files on localhost. after uploading on hosting server, i am able to download on IE, chrome. but mozilla gives a garbage file. instead of music file. I disabled vlc plugin or windows plugin and checked, still not working. Please help. In code i have given header('Content-Type: application/force-download)

所有回复 (4)

more options

If Firefox tries to open the MP3 file in a tab then that suggests that the server is sending the file as text/plain and not as a content type that force a download action.

See:

more options

First, I used header('Content-Type: application/octet-stream') to download the file. this did not work in any browser. Then i used header('Content-Type: application/force-download) . this worked in IE, CHROME but not in Mozilla FF 12 version I dont know what content type requires mozilla. why there is so much problem with mozilla. please give solution to download audio mp3 files.

more options

I am using the below code it is working in IE,CHROME. with mozilla when i click on save it is giving binary file and unable to play the file. When click on open option it is downloading in VLC and goes to temp folder. what should I do so that frm mozilla it saves the file in VLC format not in binary format.


$fname=$_GET['f'];

   $file= "music1/".$fname;

header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false);

   //header('Content-Type: application/force-download');

//header('Content-Type: application/binary'); header('Content-Type: audio/mpeg');

  	//header('Content-Type: audio/x-mp3');

header("Content-Disposition: attachment; filename=$file");

   header("Content-Length: " . filesize("$file"));
   header("Content-Description: Download");

header("Content-Transfer-Encoding: binary");

// refer to file and exit readfile("$file"); exit();

?>

more options

write now i am only using header('Content-Type: audio/mpeg');