[Zope] - RESPONSE.headers Help needed

Andy Smith andy@verticality.com
Sat, 23 Jan 1999 17:47:04 -0500


To return to an old thread....I've been trying to achieve the equivalent of
the code below in DTML. Since you can't make assignments in DTML, I've been
trying the following....

<!--#call "_['RESPONSE'].setHeader('Content-Type','application.binary')"-->
<!--#call
"_['RESPONSE'].setHeader('Content-Disposition','inline;filename=phoneBook.cs
v')"-->

IE4 opens up a window and looks as if it's about to download a file, but
then the message ...

'The downloaded files is not available. This could be due to Security or
Language settings or because the server was unable to retrieve the selected
file'. I've tried text/csv as the Content-Type as well and get the same
error.

It also says that it's trying to download the name of the document,
'displayAll' and not the desired filename, 'phoneBook.csv'

Anyone any ideas?

Cheers,

Andy.

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Jim
> Fulton
> Sent: Monday, December 28, 1998 4:12 PM
> To: BScherer@mobile.bam.com
> Cc: zope@zope.org
> Subject: Re: [Zope] - RESPONSE.headers Help needed
>
>
> BScherer@mobile.bam.com wrote:
> >
> > I'm using the following:
> >
> > RESPONSE.headers['Content-Type'] =  "text/csv"
> > RESPONSE.headers['Content-Disposition'] = "inline; \
> > filename=salesdat.csv"
>
> Don't set headers via the headers attribute.
> (I should rename this attribute, '_headers'. :)
>
> Use the setHeader method instead.  Or just:
>
>   RESPONSE[Content-Type'] =  "text/csv"
>   RESPONSE['Content-Disposition'] = "inline; \
>   filename=salesdat.csv"
>
> Jim
>
> --
> Jim Fulton           mailto:jim@digicool.com
> Technical Director   (888) 344-4332              Python Powered!
> Digital Creations    http://www.digicool.com     http://www.python.org
>
> Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
> address may not be added to any commercial mail list with out my
> permission.  Violation of my privacy with advertising or SPAM will
> result in a suit for a MINIMUM of $500 damages/incident, $1500 for
> repeats.
>
>