[Zope] Open documents as non-embedded

David Burton eloquence@eloquent-designs.f2s.com
Fri, 17 May 2002 15:50:46 +0100


Using Content-Disposition is the way to go
- using <dtml-call "RESPONSE.setHeader('Content-Disposition','attachment;filename=whatever.pdf')"> (if I've remembered the command right) is the call 
you'd need, with an appropriate filename so that the system gives a sensible filename.

You'll probably want to set the Content-Type header, although on some IE versions this will be picked up and if it's something like a PDF it will open the 
document inline just because it can, ignoring the disposition header.

Note also that these methods don't work reliably on Mac clients either - I've not found a 100% reliable method for this (it's a browser issue :( )

HTH,
David Burton

17/05/2002 15:16:07, Oliver Bleutgen <myzope@gmx.net> wrote:

>Jonas Bengtsson wrote:
>> Hi,
>> For some while ago I think this issue was discussed but I can't find
>> it now.
>> What I want is to know how to open documents (such as PDF, Word, Excel
>> etc) so that they are not embedded within the web page. I.e. I want to
>> achieve the same behavior as if the user choose "Save as..." and than
>> open the document.
>> Is it clear what I want?
>
>Search google for the http header "Content-Disposition". I just don't 
>remember if it allows the user also to "open with application" or just 
>to save the document.
>
>HTH,
>oliver
>
>
>
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://lists.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists - 
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>
"Into the abyss we stare, hoping that the abyss does not gaze so intently upon us"