question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

File Uploader never resets (not None for every session)

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
karriebearcommented, Jul 27, 2020

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!

0reactions
karriebearcommented, Dec 22, 2020

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Due to page reload, the video uploaded sing st. ...
Both A & B uses st.file_uploadeer() to upload videos to the app. However, when I switch between A & B, the uploaded videos...
Read more >
File Upload Issue - Connection Reset
Once they browse to the file and click upload they receive a message that says “connection to the server was reset while the...
Read more >
Handling File Uploads With Flask - miguelgrinberg.com
If the file upload fails, either due to the file being too large or invalid, dropzone wants to display an error message. Because...
Read more >
Why are my files skipped on upload or download?
The file or folder was not uploaded/downloaded due to a conflict with another file or folder that is in the same location in...
Read more >
Fix problems uploading files on the OneDrive website
Learn more about the error messages you might receive when you try to upload files on the OneDrive website.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found