473,396 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Image Anti-Leech

Hi,

I've been trying to play around with a simple script to stop people stealing
images (and bandwidth) but without much success :

strFolder="imageshidden"

strServer = lcase(Request.ServerVariables("server_name"))
If strServer="www.joebloggs.com" Then
strPic = strFolder & Request.QueryString("pic")
Else
strPic = "img/youarestealing.gif"
End If
Response.Redirect strPic
Is there an online tutorial or script for this ?

Thanks

John
Jul 19 '05 #1
4 2461
I think it would make more sense to test for the referring page, rather than
the server name... in other words, if the request for the image came from a
page on your server, display the image; otherwise display the alternate
image. I think the name is HTTP_REFERER but my memory might be off.

A few notes about this, though: since your "real" image is available as
yourdomain.com/imageshidden/realimage.gif, it's still possible for someone
to download it. Your script is a slight deterrent, not a prevention.

I have had problems with some browsers not including the HTTP_REFERER header
when loading images (or scripts) for a page. For the site visitors who are
using these browsers--IE for Mac is one of them--the "you are stealing"
image would always be displayed, even when the visitor tried to load the
page correctly.

The best advice I have heard--and it's been posted many times, in many
different groups--is "don't post images that you absolutely don't want
anyone to download." That's the only sure-fire way to prevent leeching.
"John Smith" <jo**@nospam.spam> wrote in message
news:bj**********@hercules.btinternet.com...
Hi,

I've been trying to play around with a simple script to stop people stealing images (and bandwidth) but without much success :

strFolder="imageshidden"

strServer = lcase(Request.ServerVariables("server_name"))
If strServer="www.joebloggs.com" Then
strPic = strFolder & Request.QueryString("pic")
Else
strPic = "img/youarestealing.gif"
End If
Response.Redirect strPic
Is there an online tutorial or script for this ?

Thanks

John


Jul 19 '05 #2
Boris,

Thanks for that, I'll have a go at using the REFERER and also disabling the
script if the USER_AGENT is a Mac.

Thanks

John

"Boris Nikolaevich" <bo***@nikolaevich.mailshell.com> wrote in message
news:uN**************@tk2msftngp13.phx.gbl...
I think it would make more sense to test for the referring page, rather than the server name... in other words, if the request for the image came from a page on your server, display the image; otherwise display the alternate
image. I think the name is HTTP_REFERER but my memory might be off.

A few notes about this, though: since your "real" image is available as
yourdomain.com/imageshidden/realimage.gif, it's still possible for someone
to download it. Your script is a slight deterrent, not a prevention.

I have had problems with some browsers not including the HTTP_REFERER header when loading images (or scripts) for a page. For the site visitors who are using these browsers--IE for Mac is one of them--the "you are stealing"
image would always be displayed, even when the visitor tried to load the
page correctly.

The best advice I have heard--and it's been posted many times, in many
different groups--is "don't post images that you absolutely don't want
anyone to download." That's the only sure-fire way to prevent leeching.
"John Smith" <jo**@nospam.spam> wrote in message
news:bj**********@hercules.btinternet.com...
Hi,

I've been trying to play around with a simple script to stop people

stealing
images (and bandwidth) but without much success :

strFolder="imageshidden"

strServer = lcase(Request.ServerVariables("server_name"))
If strServer="www.joebloggs.com" Then
strPic = strFolder & Request.QueryString("pic")
Else
strPic = "img/youarestealing.gif"
End If
Response.Redirect strPic
Is there an online tutorial or script for this ?

Thanks

John


Jul 19 '05 #3
I remember seeing an article on the different methods to try, but I can't
remember where - sorry. One solution involved setting the image source as
the background attribute of a TD tag, and then putting a transparent gif in
the TD so that it overlays the 'real' image. When a use r-clicks the image
they get the properties/source of the transparent gif. Never tried this, but
I imagine the first stumbling block will be browser compatibility. Have you
tried a Google search? I doubt there's any foolproof way.

Alan

"John Smith" <jo**@nospam.spam> wrote in message
news:bj**********@hercules.btinternet.com...
Hi,

I've been trying to play around with a simple script to stop people stealing images (and bandwidth) but without much success :

strFolder="imageshidden"

strServer = lcase(Request.ServerVariables("server_name"))
If strServer="www.joebloggs.com" Then
strPic = strFolder & Request.QueryString("pic")
Else
strPic = "img/youarestealing.gif"
End If
Response.Redirect strPic
Is there an online tutorial or script for this ?

Thanks

John

Jul 19 '05 #4
John Smith wrote:
...
I'll have a go at using the REFERER and also
disabling the script if the USER_AGENT is a Mac.


I'm afraid you will find it's not reliable. Some of your visitors will be
operating from behind routers/firewalls/proxies or using ISPs that do not
send the referrer. There are also users that deliberately set their
browsers to withold that info.

Watch your logs and change image directory names regularly is one tactic
I've seen suggested.

--
William Tasso - http://WilliamTasso.com
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Les Juby | last post by:
I'm trying to print a simple catalogue of products but where an image straddles a page break, the image either disappears completely or else the first half prints at the bottom of the page but the...
0
by: Jay | last post by:
Hi guys, trying to fix a problem with an image resize routine. The code posted below uploads and resizes a jpeg, probablem is, the outlook can look a bit bitty becuase of teh samller size...is...
3
by: Michel | last post by:
Is there a way I can anti-aliasing a gif to be able to get a hi-quality resizeable backgroundpicture. When a GIF of JPG is being resized by the browser you get wurse pictures because it needs a...
6
by: Les Juby | last post by:
I'm trying to print a simple catalogue of products but where an image straddles a page break, the image either disappears completely or else the first half prints at the bottom of the page but the...
0
by: Jay | last post by:
Hi guys, trying to fix a problem with an image resize routine. The code posted below uploads and resizes a jpeg, probablem is, the outlook can look a bit bitty becuase of teh samller size...is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.