Your very first line on your script should be the
header: header("Content-Type: application/pdf");
You can also use ob_start(), but it seems to work only with Netscape for me(?)
Alain
On Wed, Aug 08, 2001 at 07:25:32PM -0400, Adam Oliver wrote:
> I'm getting this message
> <snip>
>
> Warning: Cannot add header information - headers already sent by (output
> started at c:\program files\apache group\apache\htdocs\test\pdftest.php:2)
> in c:\program files\apache group\apache\htdocs\test\pdftest.php on line 3
>
> Warning: Cannot add header information - headers already sent by (output
> started at c:\program files\apache group\apache\htdocs\test\pdftest.php:2)
> in c:\program files\apache group\apache\htdocs\test\pdftest.php on line 26
>
> </snip>
>
> with the following code.
>
> <snip>
> <?php
> $len = filesize($filename);
> header("Content-type: application/pdf");
> header("Content-Length: $len");
> header("Content-Disposition: inline; filename=foo.pdf");
> readfile($filename);
> ?>
> </snip>
>
> The server is Apache for Win32. Any idea on how to fix it?
>
> Adam
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]