>Sounds like your file associations are bad on that PC if that's the case. Oddly, after killing off AcroRead32, it started behaving much better, so I suspect that may have been the problem in the first place. Just strange that Mozilla didn't have any issues. -----Original Message----- From: Guy Morton [mailto:guy@alchemy.com.au] Sent: Monday, 19 June 2006 7:13 PM To: Leigh Sharpe Cc: melbourne-pm Subject: Re: [Melbourne-pm] Delivering PDFs via CGI Sounds like your file associations are bad on that PC if that's the case. At any rate, the workaround *does* work for me so perhaps you have an error in your code somewhere? Perhaps you could post your code, and details of browser, OS etc you are testing with? Are you being careful to only put two new line characters on the end of your *last* header? Guy Leigh Sharpe wrote: Tried that, too. IE then attempted to open the PDF with Word. And failed miserably to do so. Regards, Leigh Leigh Sharpe Network Systems Engineer Pacific Wireless Ph 9584 8966 Mob 0408 009 502 email lsharpe@pacificwireless.com.au web www.pacificwireless.com.au _____ From: Guy Morton [ mailto:guy@alchemy.com.au] Sent: Monday, June 19, 2006 4:55 PM To: Leigh Sharpe Subject: Re: [Melbourne-pm] Delivering PDFs via CGI try adding a content-disposition line and put a filename in it, eg print "Content-Type: application/pdf\n"; print "Content-Disposition: attachment; filename=youradhere.pdf\n"; print "Content-Transfer-Encoding: binary\n\n"; hth Guy Leigh Sharpe wrote: Hi All, Is it just me or has this list been really quiet recently? Can anybody tell me how to output PDF files to a browser properly? Specifically, I'm having trouble getting Internet Explorer to recognise them as PDFs. This, for example: #!c:\perl\bin\perl.exe use warnings; use strict; my $filename="c:\\temp\\mypdf.pdf"; my $data; print "content-type:application/pdf\n\n"; open (PDFFILE,"<$filename") or die "$!\n"; binmode PDFFILE; binmode STDOUT; my $size = -s "$filename"; read PDFFILE,$data,$size || die"$!\n"; close PDFFILE; print $data; Works perfectly when accessed using Mozilla. Using IE, I just get a screen full of garbage. If I use a URL that ends in ".pdf", it works. eg, instead of http://localhost/cgi-bin/mime.cgi, use http://localhost/cgi-bin/mime.cgi?fred.pdf. All works fine. Is this a bug in my browser, or am I overlooking something here? I find the same problem with MS-Word documents. I need to have a paramater which ends in ".doc" in order to have IE open a word doc automatically. Regards, Leigh Leigh Sharpe Network Systems Engineer Pacific Wireless Ph 9584 8966 Mob 0408 009 502 email lsharpe@pacificwireless.com.au web www.pacificwireless.com.au _____ _______________________________________________ Melbourne-pm mailing list Melbourne-pm@pm.org http://mail.pm.org/mailman/listinfo/melbourne-pm