oops! `serialize` is really bad idea;)
this should work:
$.each( files, function( key, value ) {
data.append( 'file_' + key , value ); // because key = 0,
1, 2 ... - or is that what you want?
});
jQuery.ajax({
type: "POST",
url: "loadDocs",
data: data, // nothing else
cache: false,
processData: false,
contentType: false,
success: showLoadDocsInfo
});
def loadDocs():
documents = request.vars
for key in documents: # key = file_0, file_1 ...
doc = documents[key] # - cgi.FieldStorage
db_app.doc_images.insert(person='{0} {1}
{2}'.format(session.abit_f,session.abit_i,session.abit_o),file=db.doc_images.file.store(doc))
return images # - ???
On Tuesday, November 13, 2018 at 6:56:00 PM UTC+3, Константин Комков wrote:
>
> data: {data: JSON.stringify(...)}
>>
> not work
>
> As I understood serialize working only with form. I don't heve form ↑.
> Can we use serialize for file?
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.