Disable Save Picture As..

Discussion in 'JavaScript' started by Dolin, Dec 3, 2007.

  1. #1
    Hi is there a Javascript code that allows right click but blocks the save picture as.. . I added one that blocks right click I need to use other functions in the right clicks.
     
    Dolin, Dec 3, 2007 IP
  2. hrcerqueira

    hrcerqueira Peon

    Messages:
    125
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think that's not possible with javascript, what you can do is to put your images in a element background, like this:

    
    <span style="background-image: url(/path/to/image); width: ###px; height: ###px" />
    
    Code (markup):
    That way, the save image doesn't appear anymore, of course that a more tecnhical user can go inside your html code and see the images path, but that would happen even with some kind of script that hides the save image option.

    Hope this helps.
     
    hrcerqueira, Dec 3, 2007 IP
  3. adam.weiner

    adam.weiner Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3

    thanks a lot this info helped me out too ;)
     
    adam.weiner, Dec 3, 2007 IP
  4. hrcerqueira

    hrcerqueira Peon

    Messages:
    125
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You're welcome :-D
     
    hrcerqueira, Dec 4, 2007 IP
  5. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Another option is split your image in several tiles, and display those tiles together in a table or div.
    However the user always can save your picture, using a Print+Screen
    Al least, using that method your images tiles won't be used directly on another sites.
     
    ajsa52, Dec 4, 2007 IP
  6. James McMurray

    James McMurray Peon

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You can also cover them with a transparent gif/png stretched to the image's exact dimensions. If they right click -> save as they'll get a dialog box for the save, and may not realize until later that they've saved the wrong thing.
     
    James McMurray, Dec 4, 2007 IP
  7. hrcerqueira

    hrcerqueira Peon

    Messages:
    125
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    He he that's a cool trick ;-)
     
    hrcerqueira, Dec 4, 2007 IP
  8. James McMurray

    James McMurray Peon

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I'm not sure if that's how they do it, but I've tried to save some pics on Flickr and gotten a 1x1 transparent gif instead. It only happens on some file extensions, so it might be a bug instead of a security feature.
     
    James McMurray, Dec 4, 2007 IP
  9. sojic

    sojic Active Member

    Messages:
    133
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    90
    #9
    In Firefox there is:

    Tools->Page Info->Media

    You can not disable or... whaterver this feature.
     
    sojic, Dec 4, 2007 IP
  10. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #10
    You're opening up a can of worms trying to prevent people from saving things they're already looking at. It's more trouble than it's worth.
     
    joebert, Dec 4, 2007 IP
  11. Dolin

    Dolin Banned

    Messages:
    143
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Haha that's a cool trick james. I managed to even block the internet explorer save picture toolbar, but there are other softwares easily available that has their toolbar automatically on to save pictures.
     
    Dolin, Dec 11, 2007 IP
  12. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #12
    Another option is convert your images to SWF Flash objects before uploading them to the web but if that sounds too impractical, try swfIR (SWF Image Replacement tool).
    swfIR is a very simple technique to prevent image download from your website - instead of adding the standard <img> tag for embedding pictures, you define the image location in Javascript and the image will then wrap inside a Flash movie on your webpage.
    With swfIR you can apply nice visual effects to your images including borders, rounded corners, small rotations and shadows without actually modifying the original image.
    Tech savvy users can easily download the image by looking at the HTML source code of your web page but for the not-so-geeky crowd and image leech software, all they'll see is a blank Flash movie.
     
    ajsa52, Dec 23, 2007 IP
  13. Anders4000

    Anders4000 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    "I added one that blocks right click"
    Can i please get the code? :)
    I need it for my menubar on my website..:p
     
    Anders4000, Oct 13, 2009 IP
  14. semantic7

    semantic7 Member

    Messages:
    92
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    48
    #14
    No matter what you do... even a flash viewer will have to save the image and so its in cache. Somebody who is determined will be able to get the image. Its as simple as that.
     
    semantic7, Oct 13, 2009 IP