psychomantum Posted January 18, 2003 Share Posted January 18, 2003 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 Quote Link to comment https://forums.phpfreaks.com/topic/63-getting-downloads-todownload/ Share on other sites More sharing options...
psychomantum Posted January 20, 2003 Author Share Posted January 20, 2003 anyone? Quote Link to comment https://forums.phpfreaks.com/topic/63-getting-downloads-todownload/#findComment-183 Share on other sites More sharing options...
effigy Posted January 20, 2003 Share Posted January 20, 2003 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: Quote Link to comment https://forums.phpfreaks.com/topic/63-getting-downloads-todownload/#findComment-186 Share on other sites More sharing options...
phpfreak Posted January 20, 2003 Share Posted January 20, 2003 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. Quote Link to comment https://forums.phpfreaks.com/topic/63-getting-downloads-todownload/#findComment-189 Share on other sites More sharing options...
psychomantum Posted January 21, 2003 Author Share Posted January 21, 2003 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. Quote Link to comment https://forums.phpfreaks.com/topic/63-getting-downloads-todownload/#findComment-204 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.