[Product-Developers] Dynamic downloads
Craig Swank
craig_swank at nrel.gov
Tue Aug 12 13:52:04 UTC 2008
Thanks Eric,
That is exactly what I was looking for. I'll let everyone know how it
turns out.
Craig
On Aug 12, 2008, at 7:48 AM, Eric Bréhault wrote:
> Hello,
>
> in the method implementing your action, you just need to set the
> correct http header like this:
> def doAction(self, REQUEST):
> REQUEST.response.setHeader('Content-type','text/
> csv;charset='+encoding)
> REQUEST.response.setHeader('Content-Disposition',
> "attachment; filename=export.csv")
> return your_csv_content
>
> note: to produce CSV, use the csv python module
>
> Eric
>
> On Tue, Aug 12, 2008 at 3:13 PM, cswank <craig_swank at nrel.gov> wrote:
>>
>> Hello,
>> I would like to have a document_action link that calls a method which
>> generates a .csv file that is downloaded to the user's computer.
>> I've been
>> looking all around, but can't find a way do do this. Can anyone
>> point me in
>> the right direction? I already have figured out how to make the
>> document_action, so I just need to give it this functionality.
>>
>> Thanks,
>>
>> Craig
>> --
>> View this message in context: http://n2.nabble.com/Dynamic-downloads-tp714294p714294.html
>> Sent from the Product Developers mailing list archive at Nabble.com.
>>
>>
>> _______________________________________________
>> Product-Developers mailing list
>> Product-Developers at lists.plone.org
>> http://lists.plone.org/mailman/listinfo/product-developers
>>
More information about the Product-Developers
mailing list