Download sqlite .db file

Hello,
Is there a way to download a sqlite3 .db file through the st.download_button widget ?
Thanks.

Welcome to streamlit community.
You can do like this:

import streamlit as st
with open("Applet.db", "rb") as fp:
    btn = st.download_button(
        label="Download db file",
        data=fp,
        file_name="Applet.db",
        mime="application/octet-stream"
    )
1 Like

It’s working, thank you !

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