An <a href="....mp3">
link would make most browsers launch the default media player to open the mp3 file.
<a href="...mp3" download>
would make some Html5 browsers download, ie saves, the mp3 file instead.
I checked the traffic and both a
tags send Content-Type:audio/mpeg
. Does the browser look at the download
attribute and behave accordingly?
IE, even the latest version, does not honor that download
attribute. Is there another method that would work for all browsers?
Additional info: my requirement came about because some phone users complained that they do not have an option of downloading the file for listening offline.
I was aware that that PC browsers usually can usually right click and save a file in a link. I thought I could do the same on a phone browser (Android Chrome) by touch and hold, but was disappointed.
So it seems that I would have to implement two links, one to navigate and one to download, if I don't want to add code to output different Html based on browser type.
download
attribute. See Download attribute