Stop file downloading

I am writing to inform you that my code executes successfully and transfers the data into the designated variable. However, the file download functionality is being triggered, which is not required for my purposes. I would appreciate your assistance in modifying the code to disable the file downloading feature.

import base64

import streamlit as st

from datetime import datetime

if “textpara” not in st.session_state:

st.session_state.textpara = ''

mfa1 = “1Muhammad”

filename=“data.txt”

b64 = base64.b64encode(mfa1.encode()).decode()

st.session_state.textpara = f’{mfa1}’

st.markdown(st.session_state.textpara, unsafe_allow_html=True)

st.write(st.session_state.textpara)

Welcome to the Streamlit community, and thanks for your question! :balloon: If you want to disable the file download feature, simply remove any code related to file downloading, such as st.download_button or custom HTML download links. In your provided code, there is no download button or download link, so nothing will trigger a file download as written.

If you previously had a download button or link, just ensure it’s deleted from your script. Your current code only displays the variable content and does not initiate any download, so you’re all set! If you still see a download, please double-check for any st.download_button or <a download=...> HTML elsewhere in your app. For more info, see the Streamlit download button docs.

Sources: