Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

Learn More

about downloading mp3 file

  • 4 réponses
  • 1 a ce problème
  • 10 vues
  • Dernière réponse par 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)

Toutes les réponses (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');