<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Trebuchet MS">Hi Leigh,<br>
<br>
The best way I have found around this is to set the Content-Disposition
header when out putting the file. In Apache::Request this looks like:<br>
<br>
$request->content_type('application/pdf');<br>
$request->header_out("Content-Disposition" => "attachment;
filename=myfile.pdf");<br>
<br>
(CGI.pm would use a simlar syntax)<br>
<br>
This will prompt a download of the file, giving the end user the option
of saving or opening the file.<br>
<br>
HTH.<br>
<br>
David<br>
<br>
<br>
</font><br>
Leigh Sharpe wrote:
<blockquote
cite="midH00000690006d554.1150699772.mail.pacificwireless.net.au@MHS"
type="cite">
<meta content="MSHTML 6.00.2800.1491" name="GENERATOR">
<div><span class="858284006-19062006"><font face="Arial" size="2">Hi
All,</font></span></div>
<div><span class="858284006-19062006"><font face="Arial" size="2"> Is
it just me or has this list been really quiet recently?</font></span></div>
<div><span class="858284006-19062006"></span> </div>
<div><span class="858284006-19062006"><font face="Arial" size="2">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.</font></span></div>
<div><span class="858284006-19062006"><font face="Arial" size="2">This,
for example:</font></span></div>
<div><span class="858284006-19062006"></span> </div>
<div><font face="Arial" size="2"> #!c:\perl\bin\perl.exe<br>
use warnings;<br>
use strict;<br>
my $filename="c:\\temp\\mypdf.pdf";<br>
my $data;<br>
print "content-type:application/pdf\n\n";<br>
open (PDFFILE,"<$filename") or die "$!\n";<br>
binmode PDFFILE;<br>
binmode STDOUT;<br>
my $size = -s "$filename";<br>
read PDFFILE,$data,$size || die"$!\n";<br>
close PDFFILE;<br>
print $data;</font></div>
<div> </div>
<div> </div>
<div><font face="Arial" size="2"><span class="858284006-19062006">Works
perfectly when accessed using Mozilla. Using IE, I just get a screen
full of garbage. </span></font></div>
<div><font face="Arial" size="2"><span class="858284006-19062006"></span></font><font
face="Arial" size="2"><span class="858284006-19062006"></span></font><font
face="Arial" size="2"><span class="858284006-19062006">If I use a URL
that ends in ".pdf", it works. eg, instead of <a
href="http://localhost/cgi-bin/mime.cgi">http://localhost/cgi-bin/mime.cgi</a>,
use <a href="http://localhost/cgi-bin/mime.cgi?fred.pdf">http://localhost/cgi-bin/mime.cgi?fred.pdf</a>.
All works fine.</span></font></div>
<div><font face="Arial" size="2"><span class="858284006-19062006">Is
this a bug in my browser, or am I overlooking something here?</span></font></div>
<div><font face="Arial" size="2"><span class="858284006-19062006">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.</span></font></div>
<div><font face="Arial" size="2"><span class="858284006-19062006"> </span></font></div>
<div> </div>
<div> </div>
<div align="left">
<div><font face="Arial" size="2">Regards,<br>
Leigh</font></div>
<div> </div>
<div><font face="Arial" size="2">Leigh Sharpe<br>
Network Systems Engineer<br>
Pacific Wireless<br>
Ph 9584 8966<br>
Mob 0408 009 502<br>
email <a title="mailto:lsharpe@pacificwireless.com.au"
href="blocked::mailto:lsharpe@pacificwireless.com.au">lsharpe@pacificwireless.com.au</a><br>
web <a title="http://www.pacificwireless.com.au/"
href="blocked::http://www.pacificwireless.com.au/">www.pacificwireless.com.au</a></font></div>
</div>
<div> </div>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Melbourne-pm mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Melbourne-pm@pm.org">Melbourne-pm@pm.org</a>
<a class="moz-txt-link-freetext" href="http://mail.pm.org/mailman/listinfo/melbourne-pm">http://mail.pm.org/mailman/listinfo/melbourne-pm</a></pre>
</blockquote>
</body>
</html>