Interesting, although I'm seeing behavior that's inconsistent with the
bugreport... With GZipMiddleware turned on, the pdf displays in an
external viewer from both IE7 and FF2 (when I don't set the Content-
Disposition); and it also displays in-browser in IE7. The only place
it doesn't display is in-browser in FF2 (this is happening to
everyone, not just my FF2, but I've cleared the file associations and
reinstalled Acrobat Reader without any change in behavior just to be
sure). Using Firebug I can see that the browser is receiving data,
although it seems to be truncated near the start of the binary data in
the pdf -- could be a Firebug artifact, I don't know.
-- bjorn
On Jan 26, 1:51 am, Ned Batchelder <
n...@nedbatchelder.com> wrote:
> We just ran into this problem also. It's reported in ticket 6027:
http://code.djangoproject.com/ticket/6027
>
> GzipMiddleware and responses with files for content (rather than
> strings) don't get along...
>
> --Ned.
>
>
>
>
BjornSteinarFjeldPetter...@gmail.com wrote:
> > I've been tearing my hair out for a little while trying to figure out
> > why I can't display pdfs from Django in Firefox. I'm getting blank
> > windows and I know it used to work ;-)
>
> > I'm using the code from the documentation (http://
> >
www.djangoproject.com/documentation/outputting_pdf/), removing
> > "attachment;" from the Content-Disposition to make the pdf display in-
> > browser and not open an external viewer.
>
> > I've printed the response object, and everything looks ok. It works
> > fine in IE7. I can view other pdf files in FF (e.g.
> >
http://www.merlinautomation.co.uk/automation/pub/Test%20Product%20PDF...).