I used a servlet to display a local image file (c:\image.gif) to the client browser:
Code used in the servlet:
This work fine and client can see the image. However, I would like to protect the image from being saved by the reason. (i,e, client cannot get the image by right-click "save as image" on the browser), how can I do that ?
You can't. The image has to be sent to the client machine for display, and once there, there is nothing you can do to protect it.
You could try to disable right click and annoy the hell out of your users, but they can just go into the cache folder and copy it from there. Or on a Mac, just drag-n-dop it from the browser. If worse comes to worse, they could do a screen grab.
Best you can do is to watermark your images so you can prove they were yours.
I suppose you could make an image displaying applet that decrypts the image on the fly for display - that would make it harder (impossible?) to use the browser save-as function, but there is always screen capture software to grab the whole screen. Bill
Originally posted by William Brogden: I suppose you could make an image displaying applet that decrypts the image on the fly for display - that would make it harder (impossible?) to use the browser save-as function, but there is always screen capture software to grab the whole screen. Bill
Well, we would be shipping the applet code to the browser. So it would take a developer/hacker of sorts, but it is still far from impossible But I split hairs, a very interesting solution indeed. [ June 10, 2005: Message edited by: Sharad Agarwal ]