[Zope] Hacking filenames in http headers?
Dieter Maurer
dieter@handshake.de
Wed, 7 Aug 2002 19:56:56 +0200
Garikoitz Araolaza writes:
> I'm using a DTML method to get an XML view from a ZClass object.
>
> What I'm trying to do, is that when the user requests the address:
>
> http://www.mysite.com/Objects/MyObject/xml
>
> he/she gets an xml file with the ID MyObject.xml so that he can save it
> cleanly in his filesystem (or open it with his browser), so that he/she
> doesn't end up having thousands of files called simply 'xml'.
>
> I've thought that a header like:
>
> <dtml-call "RESPONSE.setHeader('content-type', 'text/xml')">
>
> could be a solution if HTTP protocol would have it... But I also think that
> it wouldn't be very clear for HTTP protocol to have one filename for the
> URL and a different one for the reply to the user.
Search for "Content-Disposition".
This header will usually work but rumours say some browsers (e.g. IE)
not always honour it.
Dieter