prot.jpg is set to NO ACCESS
The user signs in.
The user clicks on a link to open bat.cgi
bat.cgi wants to show prot.jpg
bat.cgi changes the permissions of prot.jpg to 777
bat.cgi executes "print: '<img src=prot.jpg>'"
bat.cgi changes the permissions back to 700
something like this would show the image to the screen:
[perl]
open(IMG, "< img.jpg") or die "cannot open img.jpg";
binmode(IMG); # for win32 machines
print "Content-type: image/jpeg\n\n";
while (<IMG>) { print; }
close(IMG);
[/perl]
but couldn't one just enter the url in the address bar?
You'll want to put your files outside of your Web directory, where Perl can read them and hand them out dynamically.
Here's an example of this (hope this URL is legal):
[hk8.org ]
I'd suggest reading up on the security fundamentals here for your Web server and platform, to make sure your site isn't easy to hack.