How to let users download the generated files?

I have created a Streamlit app that works fine locally. I creates 2 files based on user input; a text file and an mp3 file. I want the user to be able to download those 2 files once they have been generated but I am not sure if these are the correct codes.

Here’s the link to my app:
LInk to the public repo: GitHub - rajtilakjee/keepyourmouthshut: Acid Reflux for your Ears!
Streamlit version: 1.28.1
Python version: 3.11

You cannot write to the clients hard drive if streamlit runs on any hosted environment.
You have to use the st.download_button component:

1 Like

Thanks! Will implement the download button within my code.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.