Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > downloading mp3 questions HELP!

downloading mp3 questions HELP!
Thread Tools
emalen
Fresh-Faced Recruit
Join Date: Oct 2003
Location: Toronto, Canada
Status: Offline
Reply With Quote
Jan 25, 2004, 06:22 PM
 
i'm designing a small web site for my brother and need a little web design mp3 related advice.

I would like people to click on a link and download the mp3 - but right now if i link to the mp3.. it opens a new window and plays it in quicktime.

can anyone help me get my desired result of having a user click on a song and have the mp3 downloaded to their computer.

i'm sure there's a really simple line of html i just am not adding!

thanks for any help in advance.....
emalen
     
Sage
Mac Elite
Join Date: Apr 2003
Location: SoCal
Status: Offline
Reply With Quote
Jan 25, 2004, 08:13 PM
 
How 'bout zipping the file?
     
Simon Mundy
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Jan 26, 2004, 05:06 PM
 
Originally posted by emalen:
i'm designing a small web site for my brother and need a little web design mp3 related advice.

I would like people to click on a link and download the mp3 - but right now if i link to the mp3.. it opens a new window and plays it in quicktime.

can anyone help me get my desired result of having a user click on a song and have the mp3 downloaded to their computer.

i'm sure there's a really simple line of html i just am not adding!

thanks for any help in advance.....
emalen
You need server-side scripting so you can modify the headers information and force the browser to download rather than process the file.

Do you have that on your hosting package?
Computer thez nohhh...
     
emalen  (op)
Fresh-Faced Recruit
Join Date: Oct 2003
Location: Toronto, Canada
Status: Offline
Reply With Quote
Jan 26, 2004, 05:14 PM
 
Originally posted by Simon Mundy:
You need server-side scripting so you can modify the headers information and force the browser to download rather than process the file.

Do you have that on your hosting package?
How do i know if i have server-side scripting..i do have a cgi - bin... i can do php.... is there a specific name for 'server-side scripting'

i doubt you'll have heard of it, but my server is with digitalspace.net

thanks for your help,

emalen
     
3R1C
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Jan 27, 2004, 03:04 AM
 
Heres some php headers for ya...

header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=" . basename($theSongPath) . ";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ". filesize($theSongPath));
3R1C
     
   
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 10:41 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,