hello there i am constructing a site where i can upload my own mp3 files.
So i have the file uploaded to the server and when i link to it the browser plays the song.
Is it possible to make it so when the link is press it downloads the file instead of playing it.
For example http://www.example.com/music/song.mp3 once clicked it downloads instead of playing.
Maybe this could be done in JavaScript?
Thanks so much.
You need to set the correct header for your mp3 files. You can do that in your web server’s configuration, or you can make a “download” script that will send the correct header, and the contents of the mp3 file
If you ware using PHP, for instance, you could do something like this (from the PHP manual):