I have a page where people can view and play my mp3 files by simply clicking on a link to the file. I want to create another link that will allow them to download the file, like on this page: http://lp.imesh.com/?appid=1157&lpid=135&subid=25152848. How do I do that?
I would assume that if you just zip the file up the browser will download it rather than play it.
[FONT=verdana]I believe this is a browser setting. For example, in Firefox, you can set an option to either download an MP3 file when you click on it, or play it in the associated application. You can also right-click on the link and select Save Link As to save the MP3 file.
In other words, the website has no control over this. It’s up to the user how they configure their browser.
Mike[/FONT]
There’s a magic bit of code that works wonderfully well and is so simple to implement. And totally cross-browser complaint as well!!!
Add the words “Left click to play. Or right click and select Save as” next to each of your links…
Edit: Mikl types faster than me!
I would assume that if you just zip the file up the browser will download it rather than play it.
This would be a 2-step process for the user.
I believe this is a browser setting.
I’m looking for something that is browser independent.
Add the words “Left click to play. Or right click and select Save as” next to each of your links…
This asks the user to do something.
I’m looking for a solution that is thought free, like on this page,
http://kripalu.org/article/649/
where the users have the thinking done for them, i.e. Play Now | [URL=“http://kripalu.org/force-download.php?file=streams/yogaBreak/mp3s/grnding_flow_ck.mp3”]Download.
Here is the HTML code:
<a href="/streams/yogaBreak/yoga_break.htm" target="popup" onClick="wopen('/streams/yogaBreak/yoga_break.htm', 'popup', 400, 200); return false;">Play Now</a> | <a href="/force-download.php?file=streams/yogaBreak/mp3s/grnding_flow_ck.mp3">Download</a>
I’m looking for a tutorial on how to set this up, particularly the force-download.php code as it would be used in WordPress.
Something like this perhaps.
Looks promising. I’ll give it a try.
[FONT=verdana]Paul O’B, that’s a very informative article. I don’t have a need for it myself at present, but I’ll bookmark it for future reference. Thanks.
Mike[/FONT]
You could also use .htaccess on a specific directory of files e.g
<Files *.mp3>
ForceType application/octet-stream
Header set Content-Disposition attachment
</Files>