[ciapug] header problem
David Champion
dave at dchamp.net
Thu Apr 2 10:03:40 CDT 2009
It has other advantages... for instance you can use readfile() to access
documents that are stored outside of the web files, if you want to
control access to files.
Could it be an issue with header() not sending the correct URL for the
.pdf when you access the extranet? Can you use wget and see what the
output is? If you have something checking for login creds, you may have
to make a simple test page...
-dc
Dave J. Hala Jr. wrote:
> Are you saying that readfile might be a better choice than
> header("Location: http://www.example.com/");? I see examples of both
> in my google results and php.net
>
> It works locally in both FF and IE, and is broken externally in both FF
> and IE.
>
> On Thu, 2009-04-02 at 09:45 -0500, David Champion wrote:
>
>> Does this happen in all browsers, or just IE?
>>
>> For downloading PDF and other docs, you can do something like this:
>>
>> $file = fopen("report.pdf",rb);
>> header("Content-Type: application/pdf");
>> header(...
>> readfile($fh);
>>
>> There are some other headers that you should also send (Pragma, Expires,
>> Cache-Control...). Do some googlin' and you should find lots of examples.
>>
>> -dc
>>
>> Dave J. Hala Jr. wrote:
>>
>>> I've got a php 5.x script that creates a report. It works like this:
>>> 1) query the database based on user input
>>> 2) format the resultset as html
>>> 3) use the html to create a pdf file on hard drive
>>> 4) use the php header("location: report.pdf") function to open the pdf
>>> in the users browser.
>>>
>>> It worked well for a long time. It just stopped working. The interesting
>>> thing is it runs fine on the secure intranet, but not on the outside
>>> secure site. I double checked and there aren't any log errors and the
>>> the file is actually being created on the harddrive. It isn't a firewall
>>> issue. It would appear that the process breaks at header function.
>>>
>>> The same functions work properly on the both the inside and outside for
>>> a number of other reports that take less time. Its almost like there is
>>> timeout happening somewhere, but I'm not seeing any, nor can I find any
>>> error messages. To the end user, it just appears to hang.
>>>
>>> Has anyone seen anything like this before?
>>>
>>>
>>> :) Dave
>>>
>>>
>>>
>>>
>> _______________________________________________
>> ciapug mailing list
>> ciapug at cialug.org
>> http://cialug.org/mailman/listinfo/ciapug
>>
More information about the ciapug
mailing list