InMemoryFileManager: Missing file


I have an st.button(‘Submit’) that when clicked, generates a file and offers a st.download_button()

When “Download” is pressed, download initiates, then page is refreshed with just the “Submit” button visible.

When “Submit” is pressed again, it re-offers the “Download” button, but when it is pressed, it generates an error

InMemoryFileManager: Missing file ee70dc10787eafa72ea16575eaf44be832c7fdd132ea6766e7347647.txt

The only way to download again is to use the browser refresh button.

How to get around this error?


Hi @jeisma,

Thanks for posting!

Can you share a code snippet so we can reproduce the issue?

Caroline :balloon:


import streamlit as st

def main ( ):
    if st.button('Submit'):               
        f = 'my data'                
        st.download_button("Download data file", data=f, file_name="mydata.dat")                    
if __name__ == '__main__':