<!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>
&nbsp;&nbsp;&nbsp; $request-&gt;content_type('application/pdf');<br>
&nbsp;&nbsp;&nbsp; $request-&gt;header_out("Content-Disposition" =&gt; "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">&nbsp;Is
it just me or has this list been really quiet recently?</font></span></div>
  <div><span class="858284006-19062006"></span>&nbsp;</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>&nbsp;</div>
  <div><font face="Arial" size="2">&nbsp;#!c:\perl\bin\perl.exe<br>
&nbsp;use warnings;<br>
&nbsp;use strict;<br>
&nbsp;my $filename="c:\\temp\\mypdf.pdf";<br>
&nbsp;my $data;<br>
&nbsp;print "content-type:application/pdf\n\n";<br>
&nbsp;open (PDFFILE,"&lt;$filename") or die "$!\n";<br>
&nbsp;binmode PDFFILE;<br>
&nbsp;binmode STDOUT;<br>
&nbsp;my $size = -s "$filename";<br>
&nbsp;read PDFFILE,$data,$size || die"$!\n";<br>
&nbsp;close PDFFILE;<br>
&nbsp;print $data;</font></div>
  <div>&nbsp;</div>
  <div>&nbsp;</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&nbsp;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&nbsp;need to have
a&nbsp;paramater which ends in&nbsp;".doc" in order to have IE open a word doc
automatically.</span></font></div>
  <div><font face="Arial" size="2"><span class="858284006-19062006">&nbsp;</span></font></div>
  <div>&nbsp;</div>
  <div>&nbsp;</div>
  <div align="left">
  <div><font face="Arial" size="2">Regards,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Leigh</font></div>
  <div>&nbsp;</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>&nbsp;</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>