Please apologize me for posting the image, but unfortunately my issue can be represented better through image only.
I am making a file upload using antd upload component.
Once I finished uploading files one by one using multiple upload mode, I get the result as following image.
Here the first two objects are ignored when submitting the form after file upload.
The form data for api call has been sent like this, (Content as undefined for first two objects but works for the last where content value was provided as binary)
Simple working example:
After uploading 2 and more files, please note the console.log(e.fileList); in line no.28 of demo.tsx. The result will be like, (First object with name as File but second one as normal object)
I would like to have both object values in the same format as object. Could you please guide me why after file upload, the last one have normal object and other previous uploaded have File object?
If I upload three files then I have to call three api's in which the payloads are as follows,
Payload of first file api call https://i.sstatic.net/s23in.png
Payload of second api call https://i.sstatic.net/ZHnKT.png
Payload of third api call https://i.sstatic.net/eqYSd.png
So only the last payload has the content as binary whereas other two are undefined which prevents the image from uploading.




Objectinstead of aFilein whatever thatnormFilecallback is receiving. If you log the updatedfileListin anuseEffecthook you'll see they are allFiletypes. What are you trying to do?Objectobject you could grab that and cache in state where you are logging it. Otherwise, adabuyaman's suggestion seems valid.