Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Downloading off my site?


  • Please log in to reply
1 reply to this topic

#1 nukie

nukie

  • Members
  • 46 posts
  • OFFLINE
  •  
  • Local time:09:51 AM

Posted 12 April 2010 - 09:09 AM

Hey, Im making a website for a band which I am friends with and they would like to have a page where their fans can download their music off it.

Now a friend recommended something along the lines of this:

<a href="resources/songname.mp3" onclick="location.href='resources/songname.mp3';return false;">Song Title</a>

But all this does is start playing the song in the users prefered music player. So what users have to do is rightclick and then "Save Target As"

Im really looking for something where the user would click on the hyperlink and then the browser automatically knows to download it.

Are there any simply ways of doing this? Particularly with javascript and/or basic HTML if possible.

Thanks!

Edited by nukie, 12 April 2010 - 09:12 AM.


BC AdBot (Login to Remove)

 


#2 Delta16

Delta16

  • Members
  • 417 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Malta
  • Local time:01:51 AM

Posted 12 April 2010 - 12:37 PM

This should do what you wish.

<a href="songname.mp3">Song Title</a>


Not so complicated :thumbsup:

Regards
Delta

Edited by Delta16, 12 April 2010 - 12:42 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users