Uploading Multiple Files to Xano: Solved

@kyanaloe I love the noCode loop. I didnt think to do that.

If someone finds this and wants the JS version to only make one API call and send the files all at once, here’s what I use:

try {
var formData = new FormData();
var formFiles = document.querySelector('#offer_documents input').files;
var response;
    for (let i=0; i < formFiles.length; i++) {
    formData.append('files[]', formFiles[i]);
    }

return await axios.post('https://xano.io/api :... ccu/offer/upload_documents', formData, {
    headers: {
      'Content-Type': 'multipart/form-data'
       }
    })}
    
catch (e) {
   throw new Error("There was a problem with the uploads: " + e)
}
1 Like