Skip to content

File Uploader never resets (not None for every session) #1686

@PerplexedFox

Description

@PerplexedFox

Summary

Once uploaded a file, no matter whether the server was restarted or the app just rerun or the caches cleared - the file_uploder still saves the last uploaded file!

Steps to reproduce

up = st.empty()
 message = st.empty()
 up.file_uploader('Please, choose .csv file',  type="csv") 
 upload = st.button("Upload!")
 if not up :
   message.info("Please upload a file of type: .csv" )
   return
 else:
   message.info("File received" )

Expected behavior:

Obviously, when the app is opened, before the user has uploaded the file the message "Please upload a file of type: .csv" should be shown since no file was uploaded.

Actual behavior:

Yet, each time" File received" is shown (you can also display the contents). This is very undesired behavior since the files are private and must be shown only to the owner. Clear caches, restart server, disabling pychache etc. did not help. Disabling pychache only helps for the first run after server restart. In fact, short of creating (renaming) the uploader and starting again, I see no way to clear this uploader. Since my server has to run all the time without restarting, it would be very nice, if you fix this issue!

Screenshot 2020-07-08 at 16 20 33

Is this a regression?

That is, did this use to work the way you expected in the past?
yes

Debug info

  • Streamlit version: 0.62.1
  • Python version: 3.8.3
  • Using Conda? PipEnv? PyEnv? Pex? - no
  • OS version: Catalina 10.15.5
  • Browser version: Safari 13.1.1

Additional

Is there is any way to manually set the uploader to None?

Metadata

Metadata

Assignees

Labels

feature:st.file_uploaderRelated to the `st.file_uploader` widgettype:bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions