Uploading multiple images in web2py

201 views
Skip to first unread message

pbt

unread,
Jul 5, 2016, 5:17:56 AM7/5/16
to web2py-users
I am new to web2py. Someone please help me. Thanks in advance.How to upload multiple images in web2py? I have seen some questions in this group which are similar to that. I could not understand the answers.Can someone explain in detail how to upload multiple images.

Anthony

unread,
Jul 5, 2016, 7:22:23 AM7/5/16
to web2py-users
There is no built-in functionality. The details will depend on your requirements. Maybe point to some of the answers you have seen and explain what you don't understand.

Anthony

Fabio Ceccarani

unread,
Jul 5, 2016, 5:28:11 PM7/5/16
to web2py-users
I'm trying with dropzone.js but I have some difficult to integrate it in sqlform. Someone has used it with sqlform?
Thanks
Fabio

Ron Chatterjee

unread,
Jul 5, 2016, 6:08:29 PM7/5/16
to web2py-users
Perhaps this will help. This is not my code by the way. I modified it. 
web2py.app.multi_upload2.w2p

Massimo Di Pierro

unread,
Jul 6, 2016, 3:45:53 AM7/6/16
to web2py-users
Mind that with modern browsers (tested on chrome), dropzone is not necessary as it is the default behavior. All you need to do is use CSS to style the <input type="file"/> to make it clear to users they can drop files there.

Fabio Ceccarani

unread,
Jul 8, 2016, 6:42:35 PM7/8/16
to web2py-users
Thanks Ron.
Thanks Massimo, I have 6 upload fields (img01, img02,...img06); there is way to use multiple upload with only one <input type="file" multiple> in a SQLFORM?

Thanks
Fabio

Massimo Di Pierro

unread,
Jul 11, 2016, 2:06:01 AM7/11/16
to web2py-users
At this time there is not.

Fabio Ceccarani

unread,
Jul 11, 2016, 3:56:30 AM7/11/16
to web2py-users
Thanks Massimo.

Michele Comitini

unread,
Jul 11, 2016, 6:09:26 PM7/11/16
to web...@googlegroups.com
@fabio using dropzone.js helps, it can upload in parallel many files using the same SQLFORM, so it is not uploading in a single POST call, but many in parallel: one for each uploaded file.
The best way to do it is to write a specific action that handles just the file upload, independently from the rest of the form... 
Parallel upload works correctly if you do not use a sqlite db since sqlite by design does not allow concurrent transactions

--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages