I would like visitors to be able to download my music files, rather than have those files automatically open in their browsers' players, but I don't know how.
I have read that HTML5's download attribute is made for this, but I can't get it to work.
My site's DTD is HTML 4.01 Strict -- would that be affecting it?
The relevant markup is:
<ul>
<li><a href="Test.wav" download="Test.wav">Test.wav</a></li>
</ul>
How can I get the audio files to download instead of playing them directly in the browser?
UPDATE:
Some stackoverflow members are trying to educate me as to how this site works. They believe that one of my subsequent discoveries (posted below) isn't an answer to the above question. In my opinion it goes deeper than an answer, because it proved that my question wasn't valid. Here's what I wrote:
Thanks to Sql Surfer and Developer90 for your help. It turns out that the problem was me: I hadn't realized that, in order for the HTML 5 "download" attribute to work, my files had to be online! I had been testing them via local files on my own desktop! Once uploaded, "download" did everything it was supposed to do. As I commented (above), testing showed me that "download" works in files that are HTML 5 doctype as well as those that are HTML 4.01 (strict) doctype. My apologies for inconveniencing you!
It depends on the browser the user is. As you said, you can add the download attr in the
<a></a>html tag like this:What you may can use is the target attr. But this is to open a new tab. Example: