[H-GEN] Pdf-php puzzle

Paul Clarke paul at sitedynamics.com.au
Mon Sep 27 09:23:56 EDT 2004


Hi Clinton and all,

I have tried Clinton's suggestions but it was not the solution. My
searching on the topic has not shed any light on the topic, plenty of
information on fixes for IE but all these refer to getting IE to open
the dialogue box itself.

The capitalisation of Content-type seems to make no difference, it is
written as type in the php manual.

I am still trying to work out if it is a IE issue or an apache issue as
with the DocumentRoot directive pointing to a directory rather than a
php file, pointing IE to the file works correctly in IE on a site where
DocumentRoot points to a directory, which would suggest that there is
something being added or not being added by either apache or php.

One page that I found suggests that IE is smart enough to work out the
type of file that it is downloading, but for some reason it has a
problem when the apache server DocumentRoot is not a directory.

Still looking

Paul.

-----Original Message-----
From: general-bounces at lists.humbug.org.au
[mailto:general-bounces at lists.humbug.org.au] On Behalf Of Clinton Roy
Sent: Monday, 27 September 2004 10:24 PM
To: general at lists.humbug.org.au
Subject: Re: [H-GEN] Pdf-php puzzle


[ Humbug *General* list - semi-serious discussions about Humbug and
]
[ Unix-related topics. Posts from non-subscribed addresses will vanish.
]

Hi Paul,

> My site http://www.qfom.com.au/membership/ has the DocumentRoot line 
> of the Apache conf file pointing to a php file, this works very well 
> (as you would expect), however, I am using the following lines of php 
> code to output the file if it is a pdf file:

I'm just going to pretend that helping IE users is a compatibility
thing, and thus is on topic ;)

>       header("Content-type: application/pdf");

I believe that header name should be Content-Type, not Content-type. As
to the actual mime type, you might want to try application/octet-stream
or some such.

>       header("Content-Disposition: attachment; filename=".$file);

>From a brief google, I think you should have quotes around that 
>filename:
         header("Content-Disposition: attachment;
filename="".$file.'"');

> Now this may come as a total surprise to you but it works perfectly in

> firefox but IE produces an error "There was an error opening this 
> document. The file does not exist."

I have no access to IE to know if the above suggestions work at all.
What I can tell you is that Google links to microsoft support pages when
asked about content-disposition :)

hth,
-- 
Clinton Roy
www.humbug.org.au  - Brisbane Unix Group
staff.dstc.edu.au/croy - Blog

_______________________________________________
General mailing list
General at lists.humbug.org.au
http://lists.humbug.org.au/cgi-bin/mailman/listinfo/general





More information about the General mailing list