When you put a link in a webpage, the browser loads the HTML, then loads the images as if you were following links to the images. In short, an <img src="lalala"> tag acts exactly like a <a href="lalala"> tag. There is no problem at all with having the target of a img tag being a cgi.
So your img tag becomes <img src="image_server.pl?image=goodpic.jpg>.
The CGI becomes:
#!/usr/local/bin/perl -w use CGI qw/:all/; my $query = CGI::new(); my $file = $query->param("image"); open ( IMAGE, $file ); while ( <IMAGE> ) { print $_; } exit ;
You are on the right track. A lot of sites have "image servers" - web servers that just host images. Cuts down the load on any one server. I'll let someone else shout about security, but consider what could happen if someone typed "image_server.pl?image=/etc/password" into their browser...
____________________
Jeremy
I didn't believe in evil until I dated it.
In reply to Re: Not Strictly A perl question.
by jepri
in thread Not Strictly A perl question.
by kb2yht
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |