I am trying to process an uploaded file in a Perl program, using CGI::Application. I need to get the content type of the uploaded file. From what I read, the following should work, but it doesn't for me:
my $filename = $q->param("file");
my $contenttype = $q->uploadInfo($filename)->{'Content-Type'};
As it turns out, $q->uploadInfo($filename) returns undef. So does $q->uploadInfo("file").
Any ideas?
Thanks!