I am using a perl cgi script to display pdf files to a web browser. The pdf files are /not/ physically on the server, for security concerns. The job of the perl script it mearly authentication and display.
Authentication works fine, but displaying the PDF does not. using ggv there are many error messages, and on windows adobe acrobat just hangs forever when opening from the web browser. If i replace the PDF file with an HTML file (and change the content type back to text/html, it displays the html fine. Am i missing something while displaying the PDFs? (note: the pdf's work fine when opened directly from a local file system ... they just don't work when viewed from the browser or saved to the local file system from the browser).
the relevant code follows:
print "Content-Type: application/pdf\n\n";
open(FILE,"$file") or &error(@!);
foreach my $line (<FILE>) {
print $line;
}
close(FILE);