How an image can be protected from download? | SoloLearn: Learn to code for FREE!

0

How an image can be protected from download?

How do you disable the "save image" option on the right-click, or just disabling the right-click on images?

5/14/2020 2:11:34 PM

Milos Popovic

3 Answers

New Answer

+5

Replace your image tag with this. <img oncontextmenu="return false" src="whatever.png"> Just so you know, it won't make your website any secure but annoying, to be honest. The users can still access the source code and save images without doing "Save Image As", through the Inspect Element option present in almost all browsers.

+3

you only can prevent the click actions, however the user still able to download it from the source code files found in developer tools in the browser.

+1

Ahlin Chan, Nikhil Thank you guys for the answers, I got it.