I have some MP3 files on a website (yes, I have permission to distribute them). When someone clicks the link, I would like the Save dialog box to open without requiring a ‘right-click save as’ action.
You can’tdirectly control what happens when someone clicks the link, because it depends on his browser and settings.
I think there is also no need to, as people usually have set it the way they like and would only be confused if it was different for every site. If you put the link directly to the file, people will be alright with it.
If I clink left-click on it, it will play in winamp. If somebody else clicks on it, it might put up a download dialog, or play in his faourite mp3 player.
If you have a lot of MP3s and want people to be able to download them together without lots of clicking you could offer them all in one zip file.
The method explained in the link above tells Apache to parse files with an mp3 extension as a PHP file. Then in the PHP file (that’s disguised as an mp3 file) you throw a certain header to the browser that tells it to download instead of streaming, and the PHP file starts to pump the contents of the real mp3 file to the browser. This can be done with other scripting languages too I think.
That is a personal question and one that I don’t feel comfortable answering on such an open forum - so I’ll just lie and say that I got a friend to try it for me
PS: I would still really like to see someons’s cigarette collection :Z
Thx everyone.
Answers:
Right now if you left click the file it tries plays the MP3 in the browser.
Yes, I’ve learned that some browsers can be set to a certain preference for opening or saving.
Thanks for the FAQ. I think that is what I want. I don’t want it to be a .zip, but I’ll try hiding the type.
i know for sure that editing your .htaccess file can do it. that is why when you go to my website to download the toxicX it opens a save dialog instead of openning the python file in the browser.
just add this in the .htaccess file:
AddType application/octet-stream py
replacing the “py” with whatever ending you want, mp3, rm, wmv…