You are here: Re: How to download MP3 and not play « HTML « IT news, forums, messages
Re: How to download MP3 and not play

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация