I am setting up a website for audio files, i have uploaded an audio file and inserted in a post in given link http://darsequranmardan.com/quran/siparah-18/1-surah-al-mumenoon-ayat-1-to-16/ the audio file inserted in this post is streamable but i also want to give a download button for the users so they can download the audio file. I inserted the button and then linked it with the audio file but when user hit the download the button the audio file starts to open instead of downloading. Is there something forcing the file not to download? i have seen the other website which is doing the same but there audio file is downloadable and mine is not here is the link http://www.tasawwuf.co/namaz-ke-asrar-o-ramooz-%D9%86%D9%85%D8%A7%D8%B2-%DA%A9%DB%92-%D8%A7%D8%B3%D8%B1%D8%A7%D8%B1-%D9%88-%D8%B1%D9%85%D9%88%D8%B2/


Use this:

<a href="http://darsequranmardan.com/wp-content/uploads/2018/01/4%20Al-Rad%20Ayat-1%20Part-2.mp3" download="4%20Al-Rad%20Ayat-1%20Part-2.mp3">download</a>

The structure is:

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

Here is a great article on the download attribute.

  • You beat me to it +1. – birgire Jan 20 '18 at 18:11
  • But note that this link attribute doesn't seems to be supported by kses. So you have to be an admin to be able to add it in the editor, else it get's removed. – birgire Jan 20 '18 at 18:21
  • thank you sir it really worked, i also found out that only adding download attribute will also work. – Abu Bakar Jan 21 '18 at 5:17
  • @AbuBakar You might want the filename in the attribute for better compatibility. – Liam Stewart Jan 21 '18 at 21:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.