Display the Content-Type of an Uploaded File in Perl

#!/usr/bin/perl
use strict;
use CGI qw/:standard/;
my $q = new CGI;
my $filename = $q->param('uploaded_file');
my $contenttype = $q->uploadInfo($filename)->{'Content-Type'};
print header;
print start_html;
print "Type is $contenttype<P>";
print end_html;

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.