Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stopping copying of photos

Status
Not open for further replies.

domino3

MIS
May 20, 2003
307
GB
Is there any way in frontpage to stop people downloading photo or graphics files from my website to use in theirs?
 
There are various javascript routines to prevent right mouse button operation but there is no way of preventing your images from being copied if the visitor is determined.
Keith
 
Hi

Googled a bit and found some scripts for this function. There are many examples out there doing different thing when you rightclick. One of the better solutions I've seen is to initiate a pop-up with copyright info. Since the visitor can get the images whatever you do(There's always printscrn if all else fails), saying that the image belongs to you and asking the visitor to respect this is as far as you'll get. So, google around a bit using searchwords like "javascript +rightclick" and you'll find a solution that matches your needs. Here's some examples I found:

-------------------------------------------------
script 1
<head>
<script language=JavaScript>
<!--

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
// -->
</script>
</head>


-------------------------------------------
Script 2
<SCRIPT>
document.oncontextmenu=gris;

function gris () {
return false;
}
</SCRIPT>

-------------------------------------------
script 3
<SCRIPT language="javascript" type="text/javascript">

<!--
// please keep these lines on when you copy the source
// made by: Max - 2001 .";
var mymessage = "Sidan är kopieringsskyddad © Max.";
function rtclickcheck(keyp)
{if(navigator.appName == "Netscape" && keyp.which == 3)
{alert(mymessage);
return false;}
if (navigator.appVersion.indexOf("MSIE") ! = -1 && event.button == 2)
{ alert(mymessage);
return false;}}

document.onmousedown = rtclickcheck
//-->
</SCRIPT>

/Eyas
 
Found one with the pop-up box

<script language="JavaScript">
<!--
/*
No rightclick script v.2.5
(c) 1998 barts1000
barts1000@aol.com
Don't delete this header!
*/

var message="Sorry, that function is disabled.\nThis Page Copyrighted and\nImages and Text protected!\nALL RIGHTS RESERVED";

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->

</script
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top