# how to block image copying from html page..



## nikku12982 (Aug 22, 2006)

is there any way to block right click option and also saving image through html page ..pls help... any code or any tricks


----------



## Anand_RF (Aug 22, 2006)

No you cant stop anyone from saving images on a page. As for the right-click block, there is a code which works only for IE, not for firefox or opera. 
And I don't know it.  But I think you can find the code at www.hotscripts.com


----------



## sakumar79 (Aug 22, 2006)

Even with that, you just have to disable javascript and the file will be accessible... I think what you can do is create a flash file and embed the jpeg within it... The flash file may be retrievable but the image may not be available, but I am not sure about this.

Arun


----------



## NikhilVerma (Aug 22, 2006)

You can never do that even with flash people can just use the ScreenCopy button and paste it in notepad for the image.


----------



## Pathik (Aug 22, 2006)

i think u mean print screen and paint....  
and that has a low quality...


----------



## Ramakrishnan (Aug 24, 2006)

Even images in flash file can be retrieved using SWF decompiler.


----------



## hafees (Aug 24, 2006)

If a person is determined to save an image from the web page, no one can restrict him. 

But these three methods can be used to restrict a casual user from saving images.
1. Disabling the right click button : by using the oncontextmenu
eg: <body oncontextmenu="return false;"> .(It does nt need to be on the body tag. instead, it can be given to the DIV tag where the image is displayed)
Problems : IE and FF will work as intented. But opera doesnt know about the oncontextmenu. so it willnot work with Opera

2. By giving the original image as background, and cover it with a transparent gif image using <img> tag. In this way, when the user rightclicks and saves the image, the transparent image will be saved. In this way user is fooled.

3. Using Flash.

But all three are not perfect solutions. Methods 1 & 2 are easily tampered by saving the webpage to a local folder and then any can find the required image.

The flash method is also not very useful coz, there are decompilers which will save all files embedded in the flash movie.


----------

