0

Adding a download attribute to my mp3 link (<a href='file.mp3' download>link</a>) is supposed to ensure that the mp3 gets downloaded as opposed to played, but it doesn't work. Also tried download=true and download=file.mp3 to no avail

Was that attribute disabled or something? What's the alternative now?

drake035
  • 3,955
  • 41
  • 119
  • 229

1 Answers1

0

as stated by m.lanser in his comment, not every browser supports it. The best way to have a browser to download a file is to set its mime type to application/octet-stream, as noted also in this answer

Community
  • 1
  • 1
kaosmos
  • 558
  • 9
  • 23
  • I added , is that correct? So far it doesn't help. – drake035 Mar 17 '17 at 10:56
  • you have to set it server side in the http header, you can have a, let' say, php page that set the mime type for the mp3 you want to have downloaded. Here is some more explanations: http://www.media-division.com/the-right-way-to-handle-file-downloads-in-php/ – kaosmos Mar 17 '17 at 11:10