Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Question

Posted on 1998-11-14
6
Medium Priority
?
177 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
Basic Security of Your VPC

So, you’ve got this shiny new VPC and a fancy new application configured on your EC2 servers ready to go. This application is only accessible from your computer, which is great for security, but you need your users to be able to access it! So, what’s the easiest way to do this?

 
LVL 10

Expert Comment

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

Accepted Solution

by:
adrianward earned 100 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

Google Certified Professional - Cloud Architect

This course (1 of 3) is designed to help students who are interested in Google Cloud Platform (GCP) to become familiar with the platform, navigate the console and learn its capabilities. It will also prepare students for the Google Cloud Architect certification exam.

Question has a verified solution.

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

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

670 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