My two cents,use CGI; my $img = CGI->new->param('name'); my ($type) = (lc($img) =~ m/([^\.]+)$/s); my %switch = qw/jpg jpeg tif tiff/; $type = $switch{$type} if exists $switch{$type}; print "Content-type: image/$type\n\n"; open(IMG,"</path/to/files/$img"); binmode(IMG); binmode(STDOUT); print while <IMG>; close(IMG);
--
By a scallop's forelocks!
In reply to Re: Serving images with perl
by Adrade
in thread Serving images with perl
by fluffyvoidwarrior
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |