Please help to prevent displaying image on web browser
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Please help to prevent displaying image on web browser
Dear All,
Im looking for how to disable displaying image on web browsers.
Example I have a link http://mydomain.com/img/test.jpg.
- when I connect to this link on my browser, it will not display the image
- But I can use <img src="/img/test.jpg" to websites can read it.
I searched on google but I haven't found the solution.
Please help me to solve this problem!
For Firefox you can manage the image loading parameter in Edit/Preferences/Content, the Load images automatically box with possible Exceptions... for trusted sites.
But it only prevented displaying the image when conncect to other websites which used <img src="http://mydomain/test.jpg">.
When I clicked http://mydomain/test.jpg on my webbrowser, it can still show the image!!
I'm afraid that what you want to do is not possible.
Your rewrite code is for preventing other sites hotlinking to your images, by checking the HTTP_REFERER. When this is your own server that does the request, it should be allowed access to the image, or else it will display a webpage without its images
Yes, so can I prevent downloading images in httpd.conf?
I don't want use php or javascript because using them make displaying images slower.
What you are asking about is called Hotlink Protection. At least to my own knowledge this is done through .htaccess programming, not through the httpd.conf configuration.
Unfortunately that is not possible because when you view an image on a web page it is downloaded in some form or manner, and is always stored on the local computer. The only alternative I have seen are flash programs that act as a proxy so that only flash proxy program is stored on the local computer. This is a very new technology so I do expect the flash programs to get better as they are further developed.
Thanks joec
What I'm asking not Hotlink Protection, I just want to protect my images from downloading or copying directly.
But this seems impossible.
What you are asking is indeed impossible. For a web user to view an image, the image must first be downloaded to his or her computer. That's how the WWW works.
If a user can see the image in his browser, he or she can make a copy. Even if you disable right-click on the web page, a user can take a screenshot, crop it down, and recreate the image.
The only way to keep others from saving copies of your images is not to put them on the web.
If you are so concerned, you might consider putting a watermark directly in the middle of your images before you post them. That won't keep them from being copied, but it will
1) deter lots of folks from wanting them in the first place and
2) ensure that, if someone does take them, others will know where they came from.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.