in reply to Image Server - Multi-functional
Rather than pump the image yourself, I'd put the images somewhere in your www-server space (an unlinked unannounced directory), and then use an internal redirect:# Output an image to the browser sub show_img { my $img = shift; my ($mime) = $img =~ /\.(gif|jpe?g|png)$/; $mime = 'jpeg' if $mime eq 'jpg'; open my $fh, '<', $img or die "Could not open $img for read: $!"; binmode $fh; my $img_data = do { local $/; <$fh> }; close $fh; print header('image/' . $mime), $img_data; exit; }
The advantages are many:print redirect("/some/webpath/to/selected/image.jpg");
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|