in reply to Re: Writing binary data directly to webpage
in thread Writing binary data directly to webpage

In addition to dmitri's comment, You can get the mimetype during upload via:
my $q = CGI->new; my $filename = $q->param('file_field_name'); my $metadata = $q->fileInfo($filename); my $mimetype = $metadata->{'Content-Type'};
As documented in the CGI.pm module --
Clayton