|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
protecting website images
OK, I have set up a web page with a large amount of images. The thumbnails link to the actual image which open in a pop-up window. I need to disable right click on the images but as the thumbnails only link to the images and not to a HTML page, it is not possible to embed the 'no right-click' Javascript.
Is it possible to include the script on the main page within the thumbnail link so that I dont have to create a seperate HTML page for every image? Ta. |
|
#2
|
||||
|
||||
|
Well, if you allow people to click through to the main images not contained in a popup window, then you defeat the purpose of putting any security measure into place at all. And if people can view your source and see where the images are coming from anyway, you might as well save yourself this trouble as well.
If you want to try having each image in its own HTML page but don't want to have to create all those pages, you can do something like the following: Code:
<script language="javascript">
function imgwindow(img){
win=window.open('','imagewindow','<params...>');
win.document.write('<html code, including a reference to the image passed to the function>');
}
</script>
You'll have to tweak this pseudo-code to make it really work. I've seen tutorials out there for doing this. Basically, you assign an opened window to a variable and can then write to that window using javascript. So you can wrap each of your images in an HTML page (complete with its own right-click-disabling javascript) without having to create all these pages by calling the function onclick of the thumbnail. Of course, this still doesn't provide any real protection for your images. Anybody can view source to find the image reference anyway, and if somebody wants the image badly enough, they can dig through their cache to find it. |
|
#3
|
|||
|
|||
|
And please remember one thing, You Can not Simply Protect from copying objects/documents, once it is exposed to Intrenet.
|
|
#4
|
|||
|
|||
|
Thanks for the quick response, I will try your suggestions on my page shortly.
As I work for a Local Education Authority (LEA) and the images are various children par-taking in Summer School activities, I think security is important. We do have consent from the parents to use the images but personally, I think an extra level of security is needed. |
|
#5
|
|||
|
|||
|
this is my code for one of the thumbnail images, it refers to an 'automatic re-size' pop-up window script
<div align="center"><a href="javascript:CaricaFoto('Kirkby/Globes.jpg')"><img src="Kirkby/Globes_thumb.jpg" width="124" height="93" border="1"></a></div> |
|
#6
|
||||
|
||||
|
There is no point using any form of scripting technology to "hide" your content. It is not possible!
To protect your images, you should place them in a virtual directory which is not accessable by web users. Using "binary write" (the same method used to display images stored in a database), you can stream the image to the browser, without exposing it's location. If you are developing in ASP, check out the binarywrite method. It's quite simple to get going. Note this this will only protect your images from un-authorised users. You cannot protect images from all users, because an image must be downloaded onto a users machine in order for it to be seen (using traditional methods.). |
|
#7
|
|||
|
|||
|
Yes, this is what I thought. I think the best method would be to password protect the page using a password request form. It is not really worth storing images in a database as it is just a one off page. If it becomes an ongoing project with regular updates I will look into it further.
Thanks for advice. |
|
#8
|
|||
|
|||
|
Quote:
Regardless of how well you password protect an image, theres always the printscreen function, which captures any part of the screen that is visable, I gave up trying to protect images, just control access with .htaccess is about all u can do Real |
|
#9
|
||||
|
||||
|
As Stumpy stated earlier, It is not possible!
Disabling right click still allows for viewing of source... Browsers generally cache images anyways... If you want to save your image from being linked to directly, look into some options of your web server. |
|
#10
|
|||
|
|||
|
Image Protect... continued
Hi guys!
This is my first post here, and I'm new to javascript... BUT- I was wondering what anyone could tell me about this page: URL It seems like when I try to "steal" the "Planet Ladybird" image (which is my own image, btw), a "spacer.gif" is in its place. I know how to do this via a transparent gif file, but this is different. I am trying to come up with a solution for a client who does celebrity photography, and this seems to be a good option, but I just can't dissect the code. All I know is it is client-side javascript, and the code is: e(3663399, 372, 400, 0, false); Is this an external .js file or? Please help! Any info will be very much appreciated! Thanks! Jen |
|
#11
|
|||
|
|||
|
This is not a good idea, when I did view the webpage I didn't see any Planet Ladybird image (I normally use Mozilla Firefox or Opera with heavy ad-blocking and often Javascript turned off). I started my IE just to see what you were talking about. I would say this is not a good solution since I wasn't able to view the image. And perhaps IE users some day will start to listen to all those warning's against IE and the securityholes and turn off javascript, then they can't view the image either.
I can always steal the image with a printscreen. Last edited by EiSa : July 7th, 2004 at 05:35 PM. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > protecting website images |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|