Posted by Toby A Inkster on 11/17/07 18:40
nospam wrote:
> I want to create a hyperlink to let users download MP3's when they click.
> The default behavior is to play. I know they can right-click and save as,
> but I don't want to have to tell them that.
The proper way is to send an HTTP header saying:
Content-Disposition: attachment
This tells the browser that you *intend* for the file to be saved rather
than handled using a plugin. The browser may be configured to ignore this
preference -- and so it should be: it's really the visitor's choice what
they do with the file once it arrives on their system -- but at least you
have made your intentions known.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 11 days, 1:36.]
[Now Playing: ./bjork_-_state_of_emergency.ogg.]
Belgium
http://tobyinkster.co.uk/blog/2007/11/17/belgium/
Navigation:
[Reply to this message]
|