Multiple File upload and formData request

How to build the correct request for multiple file upload and setting dynamic formData?

hey, I am working on file upload, and i would like to upload multiple files. i am having issues while trying to setup the request to upload the files

I am using the basic file upload component. And i would like to pass al the selected input files for the upload. the Backend API expects the documents to be sent as POST with content type: ‘multipart/form-data’ with ‘files’ as key and files.

uploading a single object from the array works fine. Also i would like to know how can I build my own formData in the JavaScript and use it in the http request.

const formData = new FormData();
files.forEach((file) => formData.append(‘files’, file)); // where files: File

how can i bind such formData to the ‘fields’ in the HTTP Request when using mltipart/form-data