download rows

已查看 27 次
跳至第一个未读帖子

Andrea Fae'

未读,
2018年2月14日 05:37:172018/2/14
收件人 web2py-users
Hello, I need to create a page to download rows from a dataset to a file.
Is there any automatic possibility (embedded download function is related?) without creating a function and relative view?
Thank you

Andrea Fae'

未读,
2018年2月14日 06:00:152018/2/14
收件人 web2py-users
I'm explaining better.
I want to create a view with a button like "download" or something like it to generate a csv file from a select/query -> rows from database and after appears a dialog to select in which folder download the file

Thank you

Dave S

未读,
2018年2月14日 15:56:452018/2/14
收件人 web...@googlegroups.com


On Wednesday, February 14, 2018 at 3:00:15 AM UTC-8, Andrea Fae' wrote:
I'm explaining better.
I want to create a view with a button like "download" or something like it to generate a csv file from a select/query -> rows from database and after appears a dialog to select in which folder download the file

Thank you

I think that the folder dialog is done by the browser on the basis of content-type and content-disposition.  But my browsers tend to assume the default directory (%home%/Downloads) and just give me the save-or-open choice.

 

Il giorno mercoledì 14 febbraio 2018 11:37:17 UTC+1, Andrea Fae' ha scritto:
Hello, I need to create a page to download rows from a dataset to a file.
Is there any automatic possibility (embedded download function is related?) without creating a function and relative view?
Thank you

The download function in the welcome app is a good starting point, but it's optimized for downloading a file that's recorded in a database table.  What you want is more like what's in appadmin.py  ... see the csv() definition.

/dps


回复全部
回复作者
转发
0 个新帖子