File Uploader never resets (not None for every session)
See original GitHub issueSummary
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!
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?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
Thanks for reporting the issue! We are currently undergoing a file uploader redesign and this is an item that is being addressed. When we release the redesigned file uploader, users will get to have better control and insight into the files that are being uploaded. Stay tuned!
Hi @METAVar, this issue should be fixed in subsequent versions. Could you try upgrading to latest (0.73.1) and see if this solves your issue?