?
Solved

Images from being saved

Posted on 2003-02-24
9
Medium Priority
?
199 Views
Last Modified: 2010-05-18
Is there a way to have Images on a Web page so that people can't right click on them and save them?
0
Comment
Question by:mmbc_voltron
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 2

Accepted Solution

by:
weeezl earned 80 total points
ID: 8009683
You can do it by adding a javascript to your page. This disables the right mouse click only for images and leaves it intact for other areas of the page. You can also change the alert message in the script or remove it altogether.

Here's the code:

<script language="JavaScript1.2">

/*
Disable right click script II (on images)- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

var clickmessage="Right click disabled on images!"

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers) {
if (e.which == 3) {
alert(clickmessage);
return false;
}
}
else if (document.getElementById){
if (e.which==3&&e.target.tagName=="IMG"){
alert(clickmessage)
return false
}
}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()
</script>

Referenced:
http://www.dynamicdrive.com/dynamicindex9/noright2.htm
0
 
LVL 30

Expert Comment

by:weed
ID: 8010053
You can disable right clicks, but users will still be able to drag images to their desktop, view the source and download the images directly, or even take a screenshot. The bottom line is that if you dont want people taking your images, dont put them on the net.
0
 
LVL 19

Expert Comment

by:webwoman
ID: 8010777
It's so easy to get around a no-right-click script it's laughable. Frankly, if I want your images I'll save your page and get the location from the code, then I'll grab them directly.

I wouldn't waste the time to even put the nrc script there. All it does is annoy people who use the right click to do things like PRINT or open a link in a new window.

And the nrc script doesn't do anything for you legally -- it's not establishing your ownership of the images. To do that, you need to put a copyright line on the image. If they're yours (not clipart), you should do that. Or put a digital watermark on them. Or both.
0
Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

 
LVL 2

Expert Comment

by:weeezl
ID: 8010815
hey, it's always possible to steal stuff if you want to, but you can make it more difficult. Most users would be stopped by the javascript. Advanced or determined users wouldn't be...

I mean, this forum IS for experts right? ;)
0
 
LVL 30

Expert Comment

by:weed
ID: 8011248
Personally, i dont use the contextual menu to grab images anyway. So its certainly not going to stop me, nor is it going to stop anyone else who drags and drops images from the browser to the desktop.
0
 

Expert Comment

by:siphilp
ID: 8016139
You can deter image thiefs by putting a nice water image through it.  So no matter how they get your image in the end they will still have a nice water image to get rid of.  This could be your URL, name anything :-)

I know it's not a great solution.  I have found that it does work, however it all depends on what your images are of.
0
 
LVL 2

Expert Comment

by:weeezl
ID: 8018065
By the way, I DID answer the initial question....

"Is there a way to have Images on a Web page so that people can't right click on them and save them?"

Do these threads ever get closed?
0
 
LVL 30

Expert Comment

by:weed
ID: 8018124
Relax. Technically, yes, you answered the question but there's more to it than that.
0
 

Expert Comment

by:dryad
ID: 8042009
make a flash image in flash 6 or shockwave. :P
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

770 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