my $cgi = new CGI; my $file = $cgi->param('file'); my $type = $cgi->uploadInfo($file)->{'Content-Type'};