Solving Upload Errors and Streamlining File Iteration for Xano Integration

During this State Changers meeting, the focus was on troubleshooting an issue with file uploads using "Xano" and "WeWeb". The State Changer, Kim, experienced difficulties with multiple file uploads directly to Xano. Despite following a set of instructions shared by a colleague, errors persisted.


A deeper dive into the issue revealed that the problem was related to the interaction between HTML elements (IDs vs Classes), as well as the structure of JavaScript code. Originally, Kim was querying by ID, which was not pointing to the correct element in WeWeb. Switching from ID selection to class selection in the JavaScript code (".dub-dub-input-file-input") resolved the first issue. Next, to address the issue of single versus multiple file uploads, the traditional JavaScript append was replaced with an array method in the request being sent to Xano. This allowed multiple files to be sent as an array rather than as individual entities. In addition to this, the parameter passed to the 'append' method was changed from 'content' to 'files', matching the expected input in Xano. The final part of the meeting consisted of discussing how to handle the received array of files in Xano. Since an attachment couldn't be created from an array of files, a 'for each' loop was suggested for individual handling of files. Also, a side-discussion happened on drag-and-drop functionality. While the issue wasn't resolved entirely, the State Changers rounded off the meeting with various viable solutions. The meeting is beneficial for those facing similar issues in file handling with WeWeb, Xano, or similar tools.


(Source: Office Hours 7/5/2023 )

State Change Members Can View The Video Here
chris-montgomery-smgTvepind4-unsplash.jpg

View This Video Now

Join State Change Risk-Free