Is there a way to compress a temporary folder (like folder1) containing files and folders into a zip file and launch the download of this zip file in a browser?
import tempfile
import os
folder1 = tempfile.mkdtemp(prefix="myapplication")
folder2 = tempfile.mkdtemp(prefix=f"{folder1}/two")
with os.fdopen(f"{folder2}/test.txt", 'w+') as tmp1:
tmp1.write('this is some content')
I would like to turn the temporary folder into a real downloadable zip.