• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Serlvet to display image - how to prevent client from "Save As Image" ?

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?

thanks
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic