-
Looking for a direct downloading script
Hi, I hope I can find the script I need -- Googling "download script" doesn't help for obvious reasons.
I have a page with audio files that includes Javascript 'Play' buttons, and those works fine; but also I want to have links to simply download rather than stream the files -- without the user having to right-click the link.
In other words I want to make a link or button that when left-clicked starts a download of the file directly, so the user doesn't have to right-click and make a choice from the menus that appear.
Can this be done? Appreciate any help on this.
Thanks -- Howard Ballinger
-
-
You cannot force a certain behavior from the browser. You can only point it to a URL for the file.
However, you can attempt to change the default behavior of the browser to save rather than view the file.
There are two ways to do this:
1. Google "force download" and you will find a way to use http headers to confuse the browser into thinking the file is not something it can open directly. This does not always work.
2. Place the file in a .zip or other archive so that it cannot be opened directly. It's a little more work for you and for your visitors, but it saves bandwidth and guarantees that the user will save it to their computer rather than streaming it within the browser.
But to be honest, the best method here is just to supply a direct link to the file (in addition to any plugin players etc) and let the user do what they'd like.
This has been discussed here (and on many other websites) before, so you can try a search for old threads. The term you need is "force download".
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks