json - How to upload mutiple files using Spring RestController -


i have spring restcontroller bean, , add call recieves following structure:

 - file file1  - integer integer2  - map<customclass,file> remainingfilesmapping 

i tried creating dto object corresponds structure, couldn't figure out how create corresponding json message on client side (for me it's angular js application)

you can't put file json message. instead, have use content type multipart/form-data explained in question: how http file upload work?

to make work angularjs, need module: file upload using angularjs

note many modern uis upload file in background , submit rest of form via ajax + json. means need 2 different controllers in spring (or @ least 2 methods) , persistence store can keep either piece until other ready.

to give example, need save json somewhere (file, database) until file upload has finished. @ time, must read json again saved , process file rest of information.

but if user takes long time fill in rest of form, file might ready, first. need able handle case well.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -