## pull the file in a variable my $fh = $query->upload('upload'); ## determine the file type via the headers my $type = $query->uploadInfo($fh)->{'Content-Type'};