Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/63-getting-downloads-todownload/
Share on other sites

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:

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

 

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

header(\"Location: http://mysite.com/my.mp3\");

 

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.