I have been trying to upload files directly to Xano. I have been able to do this with individual image files and PDFs successfully, using the tutorial directions.
I have NOT been able to send:
Microsoft Office files, like .doc, .docx, .ppt, .pptx
This happens even when I select the “Word File” extension from the dropdown list for the upload element
Multiple Files at once. I tried using the iterator, but I can’t figure out what array I can tell it to parse. The files in the File Uploader are listed within an {object}
I attempted a For Loop in the custom JS action step, but that doesn’t work either.
Hi @kyanaloe, can you clarify what you’re trying to do?
If you’re having trouble using WeWeb’s no-code file upload Action in the Workflows or are you struggling with custom JS to send files directly to Xano without going through WeWeb’s CDN?
Hi @kyanaloe! I try to use your method but I cannot make Xano endopint to receive multiple images. Can you share how did you do that in Xano? I only can operate with single image upload endpoint.
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)
}
Thanks! I ve used this code but backent returns 500. I assume because I have to change Xano side where we convert input to image file, I dont know how to make it for that Obj that this code sends to Xano…
in Xano i have to populate list of images, input is list but create image from File is wrong… no tutorial in Xano how to upload multiple images.
Oh yes thats what I need for creating an image, that works!
But also I try to figure out how to EDIT parameter of my record which is image list (on my screenshot above… not to add new record but rather add item to the array
What happen if I remove the “return await” from the code?
I just used your code as reference to upload multiple files to Supabase, but to make it work I had to remove “return await” but not sure if that’s something bad
Thank you for sharing! My set up for uploading multiple files at once is still not working. By printing to the console I can see that I grab the media files. The for loop iterates. But the line to append formData doesn’t append the media file. the formData object remains undefined.
does it have to do with the first param in append? what does the ‘files’ do?