How an image can be protected from download? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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?

14th May 2020, 2:11 PM
Milos Popovic
Milos Popovic - avatar
3 Answers
+ 6
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.
14th May 2020, 3:03 PM
Nikhil
Nikhil - avatar
+ 5
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.
14th May 2020, 3:26 PM
Ahlin Chan
Ahlin Chan - avatar
+ 1
Ahlin Chan, Nikhil Thank you guys for the answers, I got it.
14th May 2020, 4:04 PM
Milos Popovic
Milos Popovic - avatar