You can
in the page referencing the image, and have it served thusly:<img src="/cgi-bin/image.pl?img=$tag.jpg">
#!/usr/bin/perl -T use CGI; use strict; my $q = new CGI; if($q->param('img') =~ /^([\w\.\-]+)$/) { # untaint my $file = $1; if(-f "/tmp/$file") { if(open(I,'<',"/tmp/$file")) { print $q->header(-content_type => "image/jpeg"); print while <I>; close I; exit; } } } print $q->header(-status => '404 Not found'); print "<h1>Not found.</h1>\n";
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: CGI-Perl:: Location for saving the GD output
by shmem
in thread CGI-Perl:: Location for saving the GD output
by cool
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |