Hi guys,
I’ve used this ‘hack’ for a few months now.
csv = df.to_csv(index=False)
b64 = base64.b64encode(csv.encode()).decode()
st.markdown('### **⬇️ Download output CSV File **')
href = f'<a href="data:file/csv;base64,{b64}">Download CSV File</a> (right-click and save as ".csv")'
st.markdown(href, unsafe_allow_html=True)
While it does the job, I was wondering whether there was anything better today (official or non-official)?
Ideally, I’d like the user to be able to click on the link without having to manually type the file extension (in this case “csv”) - Is there a way to do this currently?
Thanks in advance