On Friday, December 21, 2012 2:49:37 PM UTC-5, kk.gnu wrote:
>
> Hello all.
> I wish to send across an ods (spreadsheet) file from my pylons
> controller in such a way that the browser should ask the user to
> download the file (by presenting the usual download dialog of course ).
> Can some one help here?
> happy hacking.
> Krishnakant.
>
Looks like I gave you the Pyramid version. Here is what I use for Pylons:
response.headers['Content-type'] = 'application/pdf'
response.headers['Content-disposition'] = 'attachment;
filename={0}'.format(filename)
response.headers['Content-length'] = len(filecontent)
return filecontent
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pylons-discuss/-/cR7ARYL0dh0J.
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/pylons-discuss?hl=en.