Solved

Question

Posted on 1998-11-14
6
175 Views
Last Modified: 2013-12-25
Is there a free bandwidth protector perl script around?

Thanks

-CMD
0
Comment
Question by:CMD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 10

Expert Comment

by:MasseyM
ID: 1829570
What is the purpose of the script?  what is a "bandwidth" protector?
0
 

Author Comment

by:CMD
ID: 1829571
A bandwidth protector is a script which stops people linking to your images or graphics. So, your server can view the image, but if someone else strys to use your graphic from your server on his own server, it won't work.
It stops people from stealing your bandwidth

CMD
-----------
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 1829572
Is that something you can set on your server config?
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 10

Expert Comment

by:MasseyM
ID: 1829573
OK, I see.  Thanks for the info
0
 

Accepted Solution

by:
adrianward earned 50 total points
ID: 1829574
The problem is that if you put your images in your htdocs directory then you'll find that they're public (for anyone, anywhere). That's what the Internet is about. I'd question why you need to do this, it goes against the whole concept of a web site.

However, to do it is fairly simple. You'd upload your graphics etc into a directory outside of your htdocs. For example, say you have a cgi-bin, and I create a subdir in that called resources.

now I could write a script which gets a single parameter: a filename, and then it checks who's asking for the file and then returns it. In Perl:

#!/usr/bin/perl

if ($ENV{'REMOTE_ADDR'} eq "193.243.236.250") {
 print "Content-type: image/gif\n\n";
 print `cat resources/$ENV{'QUERY_STRING'}`;
} else {
 print "Content-type: text/plain\n\n";
 print "Only people at 193.243.236.250 are allowed to see that file";
}

But, this is a little sketchy, because it only checks on IP
addresses, which is probably not suitable for you. You could use
cookies which is better, but beyond the scope of 50 points!

Hope this helps you a little.
0
 

Expert Comment

by:adrianward
ID: 1829575
Oh, I forgot to mention how you'd use the script in my answer:

In your HTML you would then reference your images as

<IMG SRC="/cgi-bin/cgiscriptname.pl?image_file.gif">

Which would call the CGI above, passing the filename of the GIF you want to display.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question