?
Solved

Force web server to download MP3 files instead of streaming them in default media player

Posted on 2007-07-24
9
Medium Priority
?
1,626 Views
Last Modified: 2008-01-09
Hello Experts!

I'm wondering what change I'd need to make to the MIME types in httpd.conf so that if <a href="song.mp3">Click Here</a> was clicked on a web page, the MP3 would spawn an Open/Save dialog box instead of downloading the song and playing it through my default media player.

Maybe modifying httpd.conf is the wrong approach.  I obviously don't know.  Any solution is welcome.

Your input would be greatly valued and appreciated.  Let me know.  Thanks!

Brendan
0
Comment
Question by:brendanwov
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 57

Expert Comment

by:giltjr
ID: 19561723
Why not right click and select "Save link as'?
0
 

Author Comment

by:brendanwov
ID: 19561793
Hey Giltjr!

I'm building an application which distributes (legal) MP3's.  I want to force users of the product to download MP3's.  My target audience won't be sophisticated enough to know to proactively right click and save.

Thanks!

Brendan
0
 
LVL 57

Accepted Solution

by:
giltjr earned 2000 total points
ID: 19562007
Ah.  Well, part of the problem is that what to do with the file is generally based on the browser, not necessarily what the server says.

What you can try is follow the instructions at:

     http://elouai.com/force-download.php

which has a PHP script that should force a download.  I have not use this specific script, but I have done things like it.  I just don't have access to my code any more.
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
LVL 2

Expert Comment

by:jonnykeogh
ID: 19564160
You could put a MIME configuration in httpd.conf, that set all MP3 files to a different MIME type, then the browser wouldn't see it as an MP3 file, and would ask the user to download it.

    For example:
    AddType application/x-notknown .mp3

That above line should work.


J
0
 
LVL 2

Expert Comment

by:milanmk
ID: 19564389
You can put the following code either in .htaccess or httpd.conf.

AddType audio/winamp .mp3

And a link like this <a href="song.mp3">Click Here</a> will give you an Open/Save dialog box.
0
 
LVL 2

Expert Comment

by:jonnykeogh
ID: 19564402
milanmk,

That's pretty much what I've just said (use a different MIME type to confuse the browser), and he already knows how to use HTML.


J
0
 
LVL 57

Expert Comment

by:giltjr
ID: 19566210
The issue with changing the mime type is that the person downloading is still in charge. I get the pop-up asking me want to do, I know it is a MP3 so I say open with application "X" and make it a permanent change.
0
 

Author Comment

by:brendanwov
ID: 19796700
Hey Experts!

Thanks for your input on this matter.  giltjr gave me the most complete solution, so I am awarding him the points.  The script he referred me to doesn't quite work perfectly but with some tweaking I think I will get what I want.

Thanks to everyone for their input!

Brendan
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question