0

I have a website that contains a lot of mp3 files, and I'd like the user to be able to download the mp3 file by simply using the direct link. For example, one song that I have is located:

http://www.mywebsite.com/song1.mp3

How can I set up my website so that when the user accesses the direct link, the mp3 is downloaded to their computer, and the mp3 doesn't open in the browser?

Thanks!

felix_xiao
  • 1,588
  • 5
  • 20
  • 27

1 Answers1

3

Thanks to you I found a pretty cool trick :)

<a href="1.mp3" download>mysong</a>
AtanuCSE
  • 8,522
  • 14
  • 71
  • 107