Download file without download button

is there a way to download a file without using the download button? I have a button, that, if clicked, runs some different commands and one of them is downloading a file. So I’m using a st.button, I can’t use a st.download_button because I must perform different tasks at once.

How can I do that?

In this thread there are maybe some ideas?

@Franky1 Thanks. This solved the issue: Automatic Download / Select and Download File with Single Button Click - #4 by snehankekre