Old 2nd June 2003, 15:41   #1
Ian Livy
Junior Member
 
Join Date: Jun 2003
Posts: 4
Force mp3 download script?

Hi folks - from a web-designer's point of view, anyone know of a way of forcing a download of an mp3 without the end user's browser opening the associated player? (and without the usual right click save as - just a single one click button which immediately starts a download)

This site does it http://www.vsl.co.at on their download section but they've hidden their code so I can't suss out how it works....

Thanks,

Ian.
Ian Livy is offline   Reply With Quote
Old 2nd June 2003, 16:08   #2
Jay
Moderator Alumni
 
Jay's Avatar
 
Join Date: May 2000
Location: Next Door
Posts: 8,942
yea pass a special header down with the mp3 file, I did it here www.radiotoolbox.com/mp3toolbox/ just disect that script for what you need to get it to work. It's in PHP by the way.
Jay is offline   Reply With Quote
Old 2nd June 2003, 20:02   #3
Vie
Forum King
 
Vie's Avatar
 
Join Date: Dec 2001
Location: Thoron fields and Duranium shadows. Posts: Crap mostly
Posts: 7,995
Dont do that!

It drives me crazy when a site has its own music, its REALY irratating, plus when I was on my dial up I HATED the bastards that did it.

if you are going to put a music file on it, just have it as an option! PLEASE!

Member most in need of SpellCheck Lifetime Achievement Award

I'm a Twitch Streamer these days, it's weird.
Vie is offline   Reply With Quote
Old 2nd June 2003, 20:04   #4
dlinkwit27
has no CT
(Forum King)
 
dlinkwit27's Avatar
 
Join Date: Sep 2000
Posts: 13,235
Send a message via ICQ to dlinkwit27 Send a message via AIM to dlinkwit27 Send a message via Yahoo to dlinkwit27
Quote:
Originally posted by Vie
Dont do that!

It drives me crazy when a site has its own music, its REALY irratating, plus when I was on my dial up I HATED the bastards that did it.

if you are going to put a music file on it, just have it as an option! PLEASE!
ditto
dlinkwit27 is offline   Reply With Quote
Old 2nd June 2003, 21:05   #5
CraigF
Passionately Apathetic
Administrator
 
CraigF's Avatar
 
Join Date: May 2000
Location: Hell
Posts: 5,435
content-disposition is your friend

CraigF is offline   Reply With Quote
Old 2nd June 2003, 21:11   #6
duh
Banned
 
duh's Avatar
 
Join Date: Mar 2003
Location: Phoenix, AZ
Posts: 290
Send a message via AIM to duh Send a message via Yahoo to duh
if you're putting music on your site, put it in the last part of your code, that way dial-upers will still get to see your site
duh is offline   Reply With Quote
Old 3rd June 2003, 05:49   #7
Ian Livy
Junior Member
 
Join Date: Jun 2003
Posts: 4
Jay - thanks - I've sent you a private mail if you're interested in the work (paid of course).

Vie, dlinkwit27, CraigF, duh, maybe I didn't explain myself enough. I have multiple mp3s on the site in a big table in flash, each has 3 buttons - 'play', 'stop' and 'download'.

The play and stop are using a script which works fine, it's the download which doesn't work as it simply sets the mp3 downloading but it will also launch your browser mp3 settings which isn't what I want. I want the download to force a 'save as'.

If you check out the site I gave at the top as an example http://www.vsl.co.at they do exactly that, but their script is hidden.

CHeers,
Ian
Ian Livy is offline   Reply With Quote
Old 3rd June 2003, 10:06   #8
CraigF
Passionately Apathetic
Administrator
 
CraigF's Avatar
 
Join Date: May 2000
Location: Hell
Posts: 5,435
*sigh*

ok, so since you wont read up on what i said, ill just explain it to you:

in ASP:
Response.AddHeader "Content-Disposition", "attachment; filename=filename.ext"

in PHP:
header('Content-Disposition: attachment; filename=filename.ext');

change filename.ext in both cases to whatever you want the save dialog prompt to call the file.

CraigF is offline   Reply With Quote
Old 3rd June 2003, 12:43   #9
Ian Livy
Junior Member
 
Join Date: Jun 2003
Posts: 4
Craig - many thanks for taking the trouble to write that - I must confess I misenterpreted your previous post as a 'me too'.

Cheers,
Ian
Ian Livy is offline   Reply With Quote
Old 5th June 2003, 10:08   #10
Ian Livy
Junior Member
 
Join Date: Jun 2003
Posts: 4
Craig / KXRM

you have mail (PM).

Cheers,
Ian
Ian Livy is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Community Center > General Discussions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump