Alternatively, you could also use a tempfile : 
https://docs.python.org/2/library/tempfile.html 
<https://docs.python.org/2/library/tempfile.html>

> Le 12 avr. 2015 à 02:55, 'sasogeek' via web2py-users 
> <web2py@googlegroups.com> a écrit :
> 
> I managed to get it working. I looked up the download method in the Response 
> class and apparently it's looking for a table name and field in the file 
> name. I added that structure [table.field.] to my zipped file name 
> [table.field.zipfile_name.zip] and passed it to the download as an argument 
> in URL() and now it works. it zips the file, saves it, then downloads it, Now 
> the next thing I want to do is delete the saved zip file from inside my app 
> once it has been downloaded.
> 
> On Saturday, 11 April 2015 19:43:47 UTC+1, sasogeek wrote:
> I zipped the files and saved it in a folder...but how do I download it now? 
> using the the download function doesn't work...
> 
> On Saturday, 11 April 2015 13:21:03 UTC+1, Louis Amon wrote:
> I think you'd have to loop through a selection and use retrieve() 
> (http://pydal.readthedocs.org/en/latest/index.html?highlight=retrieve#pydal.objects.Field.retrieve
>  
> <http://pydal.readthedocs.org/en/latest/index.html?highlight=retrieve#pydal.objects.Field.retrieve>)
> 
> If you need a one-click download then perhaps you could zip all the files 
> using the zip <https://docs.python.org/2/library/zipfile.html> library (or 
> gzip or whatever compression you want to use ^^)
> 
> On Saturday, April 11, 2015 at 1:47:19 PM UTC+2, sasogeek wrote:
> Is there a way I could download all the files in a db or loop through a db 
> selection and download all associated files via maybe just a click on a link?
> 
> -- 
> Resources:
> - http://web2py.com <http://web2py.com/>
> - http://web2py.com/book <http://web2py.com/book> (Documentation)
> - http://github.com/web2py/web2py <http://github.com/web2py/web2py> (Source 
> code)
> - https://code.google.com/p/web2py/issues/list 
> <https://code.google.com/p/web2py/issues/list> (Report Issues)
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/Oo2EnS0qpHo/unsubscribe 
> <https://groups.google.com/d/topic/web2py/Oo2EnS0qpHo/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> web2py+unsubscr...@googlegroups.com 
> <mailto:web2py+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to