Jump to content


Photo

getting downloads to......download


  • Please log in to reply
4 replies to this topic

#1 psychomantum

psychomantum
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 18 January 2003 - 11:04 AM

Hi,

I\'m fairly new to webhosting, but I just did this web site for a band and I want users to be able to download mp3s. I put the mp3s on the site, but when you click on them they try to play in windows media player (or whatever app handles it by default on your machine). In order to download the file, you have to right click and do the \"save as...\"

I want to bypass this so that it downloads by default. Is this an Apache configuration issue or do I just need to make a small change elsewhere?

Thanks.

P.S. I\'m using Apache 2.0.40 on RedHat 8.0
The web site in question is at http://www.tripwire.us

#2 psychomantum

psychomantum
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 20 January 2003 - 03:07 AM

anyone?

#3 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 20 January 2003 - 06:26 AM

i\'m honestly not sure. you could try having the link send the filename to a php page and it sends the file via header() ... overall i think you could help the situtation, but it really comes down to how the user has their browser configured — but i may be off :shock:
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#4 phpfreak

phpfreak
  • Members
  • PipPipPip
  • Advanced Member
  • 527 posts
  • LocationEverywhere!

Posted 20 January 2003 - 12:09 PM

You\'ll have to force it with header();

header(\"Content-type: application/octet-stream\");
header(\"Location: \");

The reason why is that some browsers and operating systems like Windows for examples thinks that MP3 should stream. So, when you click on the URL, it wants to stream it.

Keep in mind, you\'ll have to create a seperate script for this and pass the URL as a variable.
Eric 'phpfreak' Rosebrock
Got LAMP?
http://www.Phpfreaks.com Founder

#5 psychomantum

psychomantum
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 21 January 2003 - 10:05 AM

thanks for the input


How exactly do I do what you said? Or, in other words, what do I put in which file to do it?

Like I said, I\'m fairly new to this stuff so you kind of have to spell it out in \"dummy format\" so that I can get exactly what you are saying.

thanks again.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users