How to use formdata to upload an array of files

Following as I'm facing the exact same issue.