Reply to Re: How to download MP3 and not play

Your name:

Reply:


Posted by cwdjrxyz on 11/17/07 04:01

On Nov 16, 9:10 pm, "nospam" <n...@spam.org> wrote:
> Hello,
>
> 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. I also have a MP3 player already
> playing on the page.
>
> One googled solution was to zip the file so when the user clicks the zip
> file,
> the browser would do a open/save as dialog. This almost works - but
> the user has to download the zip and then extract the file. I would also
> have
> to have a "zip" file for each and every MP3 file. Seems a bit bloated...
>
> I want to be able to download the file on click and bypass the play option
> that the browser/user may have installed. I played around with the 'type'
> attribute but no luck----
>
> <a type="zip" href="peoplegetready.mp3" target="_blank">people get ready</a>
>
> I don't want to do FTP and expose user/passwords, etc.
>
> Anyone do anything similar like this?
>
> Thanks in advance.
>
> Regards,
> bruce

Since mp3 files can be played by many players, you never know how the
client computer is going to respond when it connects to a mp3 file.
The owner of the computer may use any of several players for mp3 and
any of several browsers
may be used. In some cases, the mp3 file will be automatically played
on some player, in other cases the computer may ask you if you want to
download or play using which of several players, and the computer
owner may or may not have set options to always handle a mp3 in a
certain way without asking.

If you want to always force download of the mp3 and let the user
decide what to to after downloading, there is one sure way. Rename
song.mp3 as song.deletemp3 and store this file on the server. The
computer will not know this extension, and will ask what you want to
do with the file. You just select a directory to download it to. After
the mp3 is downloaded, you only need to rename the file from some
song.deletemp3 to song.mp3. In other words, you delete "delete" from
the extension. This trick will work for all other types of files I
have tested to force downloading.

On my computer, a mp3 file can be played on several players, including
WMP 11, Real 11 beta, QT, Winamp, etc. I may be using Firefox, Opera,
IE6, Seamonkey, Safari for Windows on the Windows XP OS. The way I
have my computer set up, certain combinations of browsers and players
start playing a mp3 automatically, others ask you what player you wish
to use, and still others offer download only.

[Back to original 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

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