Disallowing images to be downloaded from a website?

SolCreate

New Member
What type of code is required to ensure that any image or pdf file cannot be downloaded or saved from a website? Also, would different versions of the code be required across the different web browsers? Thank you.
 

scottg

New Member
Do you mean displaying these files on a html page, but not allowing people to save them?

If so, then I don't know of any techniques to keep pdfs from being downloaded. For images, the only way to do this through CSS by declaring a background image for an html tag. Use the css style attribute and background property. Here's an example with a div tag, assuming an image's dimensions are 100x100:

Code:
<div style="background:url(pathtoyourimage);width:100px;height:100px;"></div>

Where pathtoyourimage is the path and file name of the image.

You can use this technique for most html tags, including anchors and headings.

But if people really want the image, there is no way to stop them from taking a screen shot.
 

constanthosting

New Member
There are many ways to circumvent things such as disabling right click on a website to prevent people from right clicking on the image and saving it. One way in firefox is click on tools in firefox then click on 'page info' and then from there it will show and allow you to save images and other media. There really is no way to prevent people from getting the images. Such as the previous poster here said, they can always take a screen shot.. :(
 

SolCreate

New Member
Thank you scottg and constanthosting. I had come to that conclusion regarding the screen shot. Most of my site material (images and pdf) has to do with intellectual property that other firms shouldn't use anyway. However, we know that can't really be "followed" so closely. The CSS should work for our images though. The pdf files is another matter.
 

SolCreate

New Member
Do you mean displaying these files on a html page, but not allowing people to save them?

If so, then I don't know of any techniques to keep pdfs from being downloaded. For images, the only way to do this through CSS by declaring a background image for an html tag. Use the css style attribute and background property. Here's an example with a div tag, assuming an image's dimensions are 100x100:

Code:
<div style="background:url(pathtoyourimage);width:100px;height:100px;"></div>

Where pathtoyourimage is the path and file name of the image.

You can use this technique for most html tags, including anchors and headings.

But if people really want the image, there is no way to stop them from taking a screen shot.
Great portfolio, scottG. Thanks again for the feedback and assistance.
 
Top