I'm trying to display the .docx file in the browser using perl script but this is not work.
My script
print "Content-type: application/docx\n\n";
my $file = 'perl.docx';
open(my $f, "$file");
binmode $f;
binmode STDOUT;
my $buffer;
while (read($f, $buffer, 1024, 0)) {
print $buffer;
}
Actually this is the viewing for pdf file extract from the google search.
When run the program into browser, downloaded the pl file. How can i display on browser?