0
我試圖在文件中讀入我的perl腳本,然後根據文件類型適當地設置標題。 PDF不顯示,我在想我的服務器人有這個東西鎖定。有什麼我可能做錯了這個腳本?當通過perl腳本閱讀時,PDF在瀏覽器中不顯示
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');
}
你在客戶端看到的實際標題是什麼? – friedo 2011-12-20 22:06:04
application/pdf。我用網板上的螢火蟲進行了檢查。 – Catfish 2011-12-20 22:08:24
當你問他時,服務器人員說了些什麼? – tadmc 2011-12-20 22:26:51