I am new to CGI. I want to write an application which will open PDF file in a browser. I have written following code.
my $file = shift;
my $full_path = "$image_dir\\$file";
print "Content-type: application/pdf\n\n";
open(FIN,"< $full_path") || print "File Not Found";
$buffer = join '', <FIN>;
I am Not able to open PDF-reader and PDF document when I use this code. I would be glad if someone could provide me some hints/clues to get my job done.
Thanks to all for suggestions. blazer
's code is working fine here. I am checking with other suggestions.