One way would be to modify the response.headers object in the
controller with the customized filename.

response.headers["Content-Disposition"] = "attachment;Filename=%s.doc"
% <string>

And then return the csv data

The user's click would call the web2py action to return de csv (you
can define it in the view)

The web2py book uses this statement (10.1.6) to specify the content:
response.headers['Content-Type']='application/vnd.ms-excel'


On 27 dic, 16:50, thstart <thst...@gmail.com> wrote:
> I generate CSV content ready to use as a .csv file; don't use a database
> and have a function to do that.
>
> I want this .csv file to be available for download after click and
> the filename to be set from the application.
>
> How to do that in web2py?

Reply via email to