Are there any ways to clear file uploader values without using streamlit form

Summary

I want to clear my uploaded files upon the button click (say for eg: “Remove files” button selection ), if there is no button click action then the uploaded files should be stored in a session variable for my further processing. Is there any way to achieve that?

3 Likes

Here’s a hacky way to do it – change the key to a new value and use st.experimental_rerun, and there will be a new widget created with no files added to it yet.

10 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.