Skip to content Skip to sidebar Skip to footer

Append Object Which Contain File And String Value Into Formdata - Js

I'm finding a solution to append object which contain File and String value into FormData and send it to server (MultiPartParser of Django Rest FrameWork). Console.log(file) Now m

Solution 1:

You can not append file object and key value with FormData. Try alternative solution like this

i.e) I will add order_no with file name and in python you can use string split function to get the order_no

Fd.append('file_uploads', file, 'your_filename_here_and_order_no');

Post a Comment for "Append Object Which Contain File And String Value Into Formdata - Js"