Preventing mp3 downloads
Posted: Sat Dec 02, 2006 5:10 pm
feyd | Please use
I used htaccess to limit direct access to the files. But I noticed that as
the file plays in Media Player, you can just choose Save As! So is there
truly no way to prevent someone from saving an audio file? That doesn't seem
possible...
thanks,
brian
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Man, I have learned a lot today. I have gone through so much effort to try
and prevent people from saving files. I have mp3 files that I want
people to listen to but I don't want them to save the file. So I went
through all the pain of implementing a script.
It is PHP, but I imagine other languages would be similar:Code: Select all
function serveaudio($file) {
$link = "audio/" . $file;
$handle = fopen($link, 'rb');
header('HTTP/1.1 200 OK');
header('Date: ' . date("D M j G:i:s T Y"));
header('Last-Modified: ' . date("D M j G:i:s T Y"));
header("Content-Type: audio/mp3");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Pragma: no-cache");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Content-Length: " . (string)(filesize($link)) );
header("Content-Transfer-Encoding: Binary");
header('Content-Disposition: filename="$name"');
readfile($link);
}the file plays in Media Player, you can just choose Save As! So is there
truly no way to prevent someone from saving an audio file? That doesn't seem
possible...
thanks,
brian
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]1.[/b] Select the correct board for your query. Take some time to read the guidelines in the sticky topic.[/quote]