File Upload Component not clearing out files

I'm creating a mobile app. Unlike the image upload component, when I attempt to clear out the value of the file upload component on an event, the files attribute of the component continues to maintain the list of selected files even though the actual value has been cleared. I have not found a way to clear out the list of files without restarting the app. The image upload component does not exhibit this behavior.

Hey @neilbalthaser

You can run a JavaScript query using an event handler, such as after a data query is submitted. For example, in the "onSuccess" handler of your query, you can run the following code to clear and reset the file input:

fileInput1.clearValue();
fileInput1.resetValue();
fileInput1.clearValidation();

This ensures the file input is properly cleared and ready for the next use.

2 Likes

I'm building a mobile app and this doesn't appear to be working. Perhaps it is working on pwa's but I cannot seem to get it to work on mobile apps. I am using JS just as you show.

@neilbalthaser

It's working perfectly on the mobile app as well. Just make sure that you're triggering the JavaScript code at the appropriate event (such as onSuccess) wherever you're using it.

Mobile View:


Everything appears to be functioning as expected.