Is it possible to create a temporary folder with files?

Hello,

I would like to know if it is possible to create a temporary folder with files, to zip them and after to export them as if the user was downloading the zip file.

With the help of a button for example:

def create():
       ..

st.button('Submit', on_click=create)

Thank you very much.

Yes, you can create a temp folder using tempfile python module and either manually delete tempfolder using shutil or on exit tempfile module will delete the folder.

[[ docs ]]
https://docs.python.org/3/library/tempfile.html

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