its working now , the problem is i didnt add a response header :

response.headers['Content-Type']='application/vnd.ms-excel'


regards,



On Tue, Oct 30, 2012 at 10:36 AM, Hassan Alnatour <
[email protected]> wrote:

> Dear ALL,
>
> I have this code for my CMS  , am trying to make a button that downloads a
> csv file for the table auth_event , i did this :
>
> def UserEvents():
>     import cStringIO
>     file = cStringIO.StringIO()
>     db(db.auth_event.id >0).select(orderby=~db.auth_event.id
> ).export_to_csv_file(file)
>     return file.getvalue()
>
> But i dont understand why is it opening the csv in the browser and now
> download it  , its a file !!!  any help
>
>
> Regards,
>
> --
>
>
>
>

-- 



Reply via email to