/    Sign up×
Community /Pin to ProfileBookmark

mp3 download in HTML

I was wondering if its possible to make so that when a person clicks on a link to an mp3 on my website, it doesnt try to play it in IE, rather it just opens the file download box, and saves the file to a user specified directory. Ive looked everywhere for help on this and asked various friends, but no one seems to know, the best ive gotten is “make them .zip files” but i would rather keep the extension in tact so that the less computer savvy people will be able to figure out how to use the mp3s, and so that they wont end up with 2 files of the same size (for those that dont clean their computers). Please Help
-narf

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@brendandonhueJun 01.2003 — Whether they are played or downloaded is up to the browser and server. There are a few things you can do though.

1. Rename the file extension from mp3 to MP3.

2. Give people instructions to right click>>save as

3. Using javascript, detect if the person is using IE. If they are, you can use execCommand('SaveAs')
Copy linkTweet thisAlerts:
@narf003authorJun 01.2003 — i will try that, thanks... you said its up to the server, I have full access to anything on the server including IIS, so if this makes it eaiser, let me know.


Thanks
Copy linkTweet thisAlerts:
@brendandonhueJun 01.2003 — If you don't have the MIME type for MP3 set up, it will download the file. I THINK!
Copy linkTweet thisAlerts:
@narf003authorJun 01.2003 — tried the renaming to MP3, that didnt work, i must have it setup to play that type of file also... I wish there were an easy attribute to edit to make it automatically download, how do i use Javascript to see if a user is running IE?
×

Success!

Help @narf003 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...