Skip to content Skip to sidebar Skip to footer

Convert Json Object To Formdata (html5 Object)

I have seen many posts about converting formData to JSON object, however, I have the exact opposite use case. I have a JSON object which I would like to convert to a formData objec

Solution 1:

Try stringifying the javascript object to json.

formdata.append('file', JSON.stringify(uploadJson));

Note that JSON is a string data format and there is no such thing as a JSON object

Post a Comment for "Convert Json Object To Formdata (html5 Object)"