The function works great in my local machine, but when I publish the app in Streamlit Share, the function doesn’t work properly and when I click in the link nothing happends. I noticed that when I right click on the link and select “save link as” the file is downloaded with the defined name.
I tried to add the “target=”_blank" attribute, and it works correctly only if the file name is not specified, but I think that this is not the most usable for the user, since the file is downloaded without a specific extension.
Hi @abbmimn, thanks for your reply. I try with your code and it works perfectly in my local machine, but when I publish the app in Share Streamlit the file doesn’t download. I think theres is a little bug because when I add the atribbute “target=_blank” the file downloads, but with no name, and when I add the attribute “download=filename.csv” to define the download name, the file not download.
This is my code modified with your suggested code:
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.