dimanche 19 avril 2015

Angular $http send post request as multipart/form-data without formData object

I've been developing multistep form using angular, everything was perfect till last day. Client said they need to receive data as multipart/form-data. First i was confused, cause it's kinda weird, that it's simple form without any file grabbing. But the main thing here, is that this form will work on ie9, and i can't use formData object to post data as multipart/form-data. Can't imagine any other ideas for this issue. Maybe someone can help ? First, i tried to deserialize json data to form data using this guy's article http://ift.tt/1pqqBpa but i met another problem, it works only for "content-type:application/x-www-form-urlencoded", when i'm trying to change it for multipart , it post only source code http://ift.tt/1IYYE0n Then, i tried to change content-type on $http function, but its only telling server that we posting him data, and he need to interpret it like "multipart/form-data" but the data we post is still as json object or json string if i use $param.data.


Please, maybe someone had the same problem ?


Aucun commentaire:

Enregistrer un commentaire