Re: [Zope] Displaying pdf

2005-12-01 Thread Chris Withers
Peter Bengtsson wrote: I think you'd have to set a content-disposition header if you did that... Surely the File object that this 'some.pdf' is has all of this taken care of in its index_html() No, OFS.Image.File sets no content-disposition header. cheers, Chris -- Simplistix - Content Ma

Re: [Zope] Displaying pdf

2005-12-01 Thread Peter Bengtsson
On 12/1/05, Chris Withers <[EMAIL PROTECTED]> wrote: > Peter Bengtsson wrote: > > pdffile = getattr(context, 'some.pdf') > > return pdffile > > I think you'd have to set a content-disposition header if you did that... > Surely the File object that this 'some.pdf' is has all of this taken care of in

Re: [Zope] Displaying pdf

2005-12-01 Thread Richard Smith
Chris Withers wrote: Peter Bengtsson wrote: pdffile = getattr(context, 'some.pdf') return pdffile I think you'd have to set a content-disposition header if you did that... cheers, Chris I wondered, but it seems to work in both firefox and ie without. Rick

Re: [Zope] Displaying pdf

2005-12-01 Thread Chris Withers
Peter Bengtsson wrote: pdffile = getattr(context, 'some.pdf') return pdffile I think you'd have to set a content-disposition header if you did that... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk

Re: [Zope] Displaying pdf

2005-11-30 Thread John Barham
On 12/1/05, Rick Smith <[EMAIL PROTECTED]> wrote: > Perhaps someone can point me in the right direction. > > I am trying to display a pdf file (actually stored in LocalFS) from a > python script. To do this my approach (probably there's a better way) is :- > > RESPONSE.setHeader('Content-Type','ap

Re: [Zope] Displaying pdf

2005-11-30 Thread Peter Bengtsson
Why the fancy RESPONSE stuff. What's wrong with just clicking on the pdf URL? Or like this from a python script called showPDF() pdffile = getattr(context, 'some.pdf') return pdffile On 12/1/05, Rick Smith <[EMAIL PROTECTED]> wrote: > Perhaps someone can point me in the right direction. > > I am

[Zope] Displaying pdf

2005-11-30 Thread Rick Smith
Perhaps someone can point me in the right direction. I am trying to display a pdf file (actually stored in LocalFS) from a python script. To do this my approach (probably there's a better way) is :- RESPONSE.setHeader('Content-Type','application/pdf') RESPONSE.redirect(path) My main problem is