Protect image download
No there actually is no way to prevent a user from doing a particular task. But you can always take measures! The image sharing websites have a huge team of developers working day and night to create such an algorithm where you prevent user from saving the image files.
First way
Try this:
$('img').mousedown(function (e) {
if(e.button == 2) { // right click
return false; // do nothing!
}
}
So the user won't be able to click on the Save Image As... option from the menu and in turn he won't get a chance to save the image.
Second way
Other way is to use background-image
. This way, the user won't be able to right click and Save the Image As... But he can still see the resources in the Inspector.
Third way
Even I am new to this one, few days ago I was surfing Flickr when I tried to right click, it did not let me do a thing. Which in turn was the first method that I provided you with. Then I tried to go and see the inspector, there I found nothing. Why? Since they were using background-image
and at the same time they were using data:imagesource
as its location.
Which was amazing for me too. You can precvent user from saving image files this way easily.
It is known as Data URI Scheme: http://en.wikipedia.org/wiki/Data_URI_scheme
Note
Please remember brother, when you're letting a user surf your website you're giving him READ permissions on the server side so he can read all the files without any problem. The same is the issue with image files. He can read the image files, and then he can easily save them. He downloads the images on the first place when he is surfing your website. So there is not an issue for him to save them on his disk.
How to prevent user from downloading or saving an image?
If the user can see the image, it's already on his computer. Saving it to a file or copying it to the clipboard is trivial and cannot be disabled in any reliable way.
If you want to keep control over the image, don't put it on the internet.
Watermarking is the best you can do.
Right click to download pictures, to protect your privacy outlook prevent automatic downloads of this picture
Firstly, your images use relative urls (uris), so they will never work in an email.
Secondly, you need to add the images as MIME parts to the message and refer to them using a cid, e.g. <img src="cid:MyCid">,
where MyCid
is the value of the Content-Id MIME header on the image MIME part.
Related Topics
Prevent Bootstrap Modal from Disappearing When Clicking Outside or Pressing Escape
Text-Align Class for Inside a Table
Expand Div to Max Width When Float:Left Is Set
HTML Ordered List 1.1, 1.2 (Nested Counters and Scope) Not Working
Send Email from Static Page Hosted on Github Pages
Next.Js Redirect From/To Another Page
What Characters Are Allowed in the HTML Name Attribute Inside Input Tag
How to Add a "Search" Button in a Text Input Field
How to Generate an HTML Report for Junit Results
Hide Horizontal Scrollbar on an Iframe
Jquery: 'Uncaught Typeerror: Illegal Invocation' at Ajax Request - Several Elements
Why Display Grid with 100% in Grid-Template-Columns Goes Out of Body
Xslt: Moving a Grouping HTML Elements into Section Levels
Where Is the HTML5 Document Type Definition
How to Add Hamburger Menu in Bootstrap
Why Does CSS Work with Fake Elements