Streamlit Sharing - Fileupload, where does it go?

So, I successfully shared my app via Streamlit Sharing. Even the upload file part works but, my quesion is, does the file persist anywhere (i.e., will it be there in a few days somewhere like in Github ( i didn’t see it)) or, does it reside in memory and clear when the browser/session is terminated?

thanx

Great work team.

1 Like

Hi @Joe_Pawlowski -

When you upload a file using file_uploader, the data is written to RAM. It will persist in memory for a while (depending on the cache settings), but it will never persist on disk unless you choose to do that yourself.

Best,
Randy

Oh so, for streamlet sharing I have the option to have the uploaded file persist in my GitHub directory? Thanks for your reply

I don’t think so, you’ll probably have to persist it somewhere else… s3 for instance…

Thanks for your reply. S3?

Amazon S3, or other file storage service that you can access programatically.

Pandas should be capable of writing to s3 storages easily

Once you read your uploaded data into a DataFrame you would call something like:

df.to_csv('s3://path/to/your/file')

To save it.

If you need to save files and not data frames. There is a Lib to interface s3

2 Likes

Ahhhhh. Sneaky!

Seems like that would work with any cloud path.

Awesome. Thank you

Right, there’s no default Streamlit option, but there is the default Python file writing capabilities, pandas, JSON, etc