Form data with multiple files

Hello, I am trying to upload multiple files to a REST API using multipart form data. My request form data on Postman looks like this:

So it's pretty straightforward, the API can receive any number of files and it works perfectly on Postman. But I'm not able to do the same on Retool, I'm trying to pass an array of files as a form-data body but it's not working. It's the first time I need to pass an array of files through retool, usually it's just one file, so I don't know exactly what I have to do. Any suggestion?

Try this:

My api was supposed to receive an array of files, so I didn't tried it first because of it. But I already changed it to receive only one file and tried to do this (an that's the way I usually do to upload files), and now I have another problem related to my API that's not relevant to the question and I'm already looking into it. So, just to clarify, there's no way that I can send a array of files instead of making one request to each file I want to upload?

Well you would have to build the array for each file but there is no point in doing that if your API accepts one file at a time and you iterate through the array of files in the field itself....

  • For each file, the upload query (uploadToS3 in this example)(in your example it's your API) is triggered.

I used such solution: Add an array of all files from inputs or one multiple filepicker. My API also expects an array of file.