Look at the code samples under http://web2py.com/books/default/chapter/29/10#CSV
On Dec 22, 10:09 pm, thstart <[email protected]> wrote: > I want the visitors to be able to download a CSV file. > > here is my code: > def download(): > response.headers['Content-Type'] = 'text/csv' > attachment = 'attachment;filename=' + file+ '.csv' > response.headers['Content-Disposition'] = attachment > > content = '....,....,....' > raise HTTP(200,str(content), > **{'Content-Type':'text/csv', > 'Content-Disposition':attachment + ';'}) > > When I click on the link download, I get 'Undefined' in the browser > and nothing is downloaded. > > What is wrong?

