To answer my own question:
     @expose()
     def export(self, **kw):
         response = pylons.response
         response.headers['Content-type'] = "text/x-csv"
         response.headers['Content-Disposition'] = "attachment;
filename=YOUR_FILE.csv"
         return "1,2,3,4"


On Apr 24, 1:50 pm, percious <[EMAIL PROTECTED]> wrote:
> I tried something like this:
>
>     @expose()
>     def export(self, **kw):
>         response = pylons.response
>         response.headers['Content-type'] = "text/x-csv"
>         response.headers['Content-Disposition'] = "attachment;
> filename=YOUR_FILE.csv"
>         response.body = '1,2,3,4\n'
>         raise response
>
> But it appears not to work.
>
> any ideas?
>
> -chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to