[ciapug] header problem
Dave J. Hala Jr.
dave at 58ghz.net
Fri Apr 3 09:15:17 CDT 2009
I gave the readfile thing a try, same issue. However, I did manage to
get an error message. I got a "couldn't find or couldn't open" error
message that listed the script name. (was tough to tell the exact error
as an end user was trying to read it to me)
When I narrowed the date range so that the report ran faster, it worked
fine. It seemed to be problematic when the execution time was above 2
minutes. I'm going look for an ssl timeout, a session timeout or maybe
in the php.ini for script execution time.
On Thu, 2009-04-02 at 11:11 -0500, Dave J. Hala Jr. wrote:
> The Live headers is a nice tool. I just used it to confirm that there
> isn't anthing wrong with the headers. (as far as I know)
>
> I'm going to ahead and give the readfile thing a try.
>
>
>
> On Thu, 2009-04-02 at 10:24 -0500, Matthew Nuzum wrote:
> > On Thu, Apr 2, 2009 at 10:03 AM, David Champion <dave at dchamp.net> wrote:
> > > 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...
> > >
> >
> > There's a firefox extension called "Live HTTP Headers" which can be a
> > big help in these situations. You just open the window and it lets you
> > inspect the http headers (in both directions).
> >
> > I too use the readfile method in these situations. I'd try it without
> > the header() statement once. Naturally you're going to get a bunch of
> > garbage to the window but if there's a PHP error at least you'll see
> > what it is.
> >
> > Here is the PHP I use to generate the necessary http headers. There
> > may be a better way now, I wrote this code years ago:
> >
> > header("Content-Type: application/octet-stream");
> > header("Content-Length: $size");
> > header("Content-Disposition: attachment; filename=\"$name\"");
> > header("Content-Transfer-Encoding: binary");
> >
> > The benefit of your technique using the redirect is it lets the server
> > deal with the headers. I don't think your way is wrong or bad. It
> > should work.
> >
> > Maybe your filesystem is getting full or for some reason your script
> > can't write the output file. Turning off the header will probably
> > expose this.
> >
--
___
Dave J. Hala Jr.
President OSIS, Inc.
www.osis.us
More information about the ciapug
mailing list