问题
I use the following code to add a Music player in my site,
<div id="player" style="z-index:100;"></div><!--Player-->
<script language="javascript" type="text/javascript">
var so = new SWFObject("flashmp3player.swf", "player", "242", "150", "9"); // Location of swf file. You can change player width and height here (using pixels or percents).
so.addParam("quality", "high");
so.addParam("wmode", "opaque");
so.addVariable("content_path","<? echo $playerpath; ?>");
so.addVariable("color_path","default.xml");
so.addVariable("script_path","flashmp3player.php");
so.write("player");
</script>
The MP3 files in a folder $playerpath (example: parentfolder/childfolder) will be played by the player. But I do not want the visitors to download the MP3 files. But users who have Internet Download Manager installed in their system see a icon at the left bottom whenever each song plays. Whenever they click the icon the song gets downloaded. How to prevent this?
回答1:
This is intrinsic to the fact that you're sending bare MP3 files to the client. Trying to stop this, as implemented, is like trying to stop people from stealing your images by blocking their ability to right-click on the page. More than likely, this "Internet Download Manager" sees the fact that a request for an MP3 file is going out from the browser, like so:
GET /my_aweseome_file.mp3 HTTP/1.1
At which point, it says, "hey, the user's browser is loading an MP3, let's download it". So, if you want to prevent this, don't allow the client to request MP3 files. You could store them in a Flash file or something else, or even stream them from an Icecast server, if you just want them to play back. Keep in mind, though, that at some point, the audio has to be heard, much like the aforementioned images must be seen, and something at some point will be able to capture that audio or that image for storage.
来源:https://stackoverflow.com/questions/11158657/how-to-prevent-idm-capturing-mp3-files