The web2py book says:

Because Ajax post does not support multipart forms, i.e. file uploads, 
> upload
> fields will not work with the LOAD component
>

This is a pity, as we are expected to split backend and frontend these 
days, and ajax comes handy. I have found other people hitted the same 
problem but didn't find a solution:

   - 
   
https://groups.google.com/forum/#!searchin/web2py/upload$20file$20ajax/web2py/6yL1pNd7QE0/-9z7DWoQyDwJ
   - 
   
https://groups.google.com/forum/#!searchin/web2py/upload$20file$20ajax/web2py/PmvIKczfn84/MCJso4P0vXEJ
   - 
   
https://groups.google.com/forum/#!searchin/web2py/upload$20file$20ajax/web2py/IHSnr6cppBQ/2FCBSgCCUTcJ

Then I realized there is one part of my app that has been doing file 
uploads via ajax for a long time. I grabbed it from this example appliance 
by Massimo, and never researched the code in depth:

https://github.com/mdipierro/web2py-appliances/tree/master/FileManager


I did some research and found it is using the jQuery.form library, which 
can do file uploads via ajax:


http://malsup.com/jquery/form/#file-upload


I write this in the hope that people trying to do fle uploads via ajax find 
this library, and the example app by Massimo, and it helps them.

-- 
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