> > request.post_vars is always key-value mapping, and you're asking one of > its values to be a mapping itself (uploading should have a "key" named > file). This is only possible under a particular circumstance, i.e. when > you're posting a json object, but it seems that you're instead trying to do > something that in ajax isn't possible (submitting a file). >
As long as the browser supports it, you should be able to upload a file via Ajax using the FormData object (part of XHR Level 2). In web2py, the uploaded file should be available as a cgi.FieldStorage object, which should have a ".file" attribute. I'm not sure exactly what's wrong in this case, but in theory one might expect request.post_vars.uploading.file to contain the file object. @seank, have you confirmed that event.target.files[0] is in fact a file (i.e., confirm in the browser console)? If you view the contents of the Ajax request in the browser developer tools, can you confirm that a file was actually sent? Maybe there is an error elsewhere in your JS code. Anthony -- 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.

