Securing those environment variables is not needed, since you don't spawn any kids.
You're using the wrong MIME type for "JPEG" images. It's should be image/jpeg.
die is not very appropriate for CGI scripts.
exit is not needed.
sysread is probably more appropriate, but I find $/ = \2048 and $/ = \$buffer_size neat:
local $/ = \2048; open(my $fh, '<', $path) or die "Failed to open $path: $!"; binmode($fh); binmode(STDOUT); print while <$fh>;
In reply to Re: Serve image from file
by ikegami
in thread Serve image from file
by ruzam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |