Download Force instead of streaming mp3 file to FF

As the name says, I would like to download an mp3 file, and not play in Firefox.

I do it like this:

<a href="http://test.com/path/to/my/file.mp3" download></html>

In all other browsers, the file loads, only Firefox starts playing the audio file instead of asking me if I want to save it to my hard drive.

+4
source share
3 answers

Write it down

<a href="http://test.com/path/to/my/file.mp3" download></html> WRONG

it should be

<a href="http://test.com/path/to/my/file.mp3" download="file.mp3">download</a>
+15
source

This is the correct way to force download:

<a href="http://test.com/path/to/my/file.mp3" download="true">download</a>

NB: it will work on Firefox only if the file is in the same domain , unfortunately, cf. https://bugzilla.mozilla.org/show_bug.cgi?id=874009

+4
source

I used <a href="http://test.com/path/to/my/file.mp3" download >download</a> If you use download = "true" inside the anchor, this will rename the file name to true.mp3 in chrome firefox, as mentioned above.

0
source

All Articles