I'm trying to read in a file to my perl script and then set the headers appropriately based on the filetype. PDFs are not displaying and i'm thinking that my server guy has this thing locked down. Is there anything that I may be doing wrong with this script?
my $q = CGI->new; #instantiate the CGI object
my $filename = $q->param('file'); # get the file param from the query string
my $text = read_file($filename); # read in the file
my($name, $path, $suffix) = fileparse($filename, qr/\..*/);
if($suffix eq ".pdf") {
print $q->header('Content-type: application/pdf');
} else {
print $q->header('text/html');
}