Open documents as non-embedded
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? -- Best regards, Jonas The brain is a wonderful organ. It starts working the moment you get up in the morning, and does not stop until you get into the office. - Robert Frost
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
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"
David and Oliver, thanks for your help! -- Best regards, Jonas Nobody goes there anymore; it's too crowded. - Yogi Berra Wednesday, May 15, 2002, 5:18:04 PM, I 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?
participants (3)
-
David Burton -
Jonas Bengtsson -
Oliver Bleutgen