Download Button and Dynamically generated data

Hi

I have noticed that data param in st.download_button expects data to be already in memory, and it doesn’t wait for the data to be generated.

=From Docs

Note that the data to be downloaded is stored in-memory while the user is connected, so it’s a good idea to keep file sizes under a couple hundred megabytes to conserve memory.

I have a case where I want to download data from a server on demand and then export it to file?

is it possible?

Hi @dpandav , you could generate your data before the st.dowload button, and then have the button to actually download it.

If you search for ‘dowload button’ on this forum, you will get many examples on how to implement the same.

Cheers

1 Like