-3

Ok,

I have a script on my website that counts the amount of clicks and downloads each of the images on the site gets, but I have noticed that people have been right clicking and downloading the images, or dragging them to the top bar to get them without clicking on them.

Is there any way I can stop them from being able to get the image without clicking on it first? I have disabled right click already, but there is still a way to get the images (by dragging the image to the url bar).

Thanks

Callum Watson
  • 33
  • 1
  • 6
  • 9
    no there is none – Secret Feb 28 '15 at 15:05
  • This could probably help you: [1]: http://stackoverflow.com/questions/4211909/disable-dragging-an-image-from-an-html-page – Sahil Nagpal Feb 28 '15 at 15:06
  • 5
    So... you want to display images on your website but don't want people to be able to request those images? Sorry, it doesn't work that way. People can either see the images or they can't. Not both. – David Feb 28 '15 at 15:07
  • even using js, it remains not working. – Joe Kdw Feb 28 '15 at 15:08
  • 1
    There **are** 2 ways to prevent downloading images, but not capturing them by screenshot: 1. Flash 2. PHP integration: read images and output them pixel by pixel as divs with background color. **Conclusion: you don't want to do that and you can't by client-side script** – Daniel Cheung Feb 28 '15 at 15:11
  • You can try cutting up the images so people have a hard time putting them back. I've seen sites do that. – Daniel Cheung Feb 28 '15 at 15:12
  • @DanielCheung Such a waste of time. All you have to do is screencap it. – Alexander O'Mara Feb 28 '15 at 15:13
  • @JánosWeisz Hohoho, I have once had this sick idea, but I discarded it. – Daniel Cheung Feb 28 '15 at 15:13
  • possible duplicate of [How to prevent downloading images and video files from my website?](http://stackoverflow.com/questions/1294501/how-to-prevent-downloading-images-and-video-files-from-my-website) – Trevi Awater Feb 28 '15 at 15:35

1 Answers1

0

As far as I know, you can't. Because there is always a url in the source code.

You can prevent right-click with the below code if it helps. Also take a long at a previously asked question Disabling right click on images using jquery. You can use flash or overlay it with another transparent/blank image to make it difficult to copy.

 $(function () {
     $(this).bind("contextmenu", function (e) {
         e.preventDefault();
     });
 });
Community
  • 1
  • 1
Maki
  • 625
  • 4
  • 11
  • 26