def zipdir(path, ziph):
# ziph is zipfile handle
for root, dirs, files in os.walk(png_path):
for file in files:
ziph.write(os.path.join(root, file))
zip_path = 'Python.zip'
zipf = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED)
zipdir('tmp/', zipf)
zipf.close()
with open(zip_path, "rb") as f:
bytes = f.read()
b64 = base64.b64encode(bytes).decode()
href = f'<a href="data:file/csv;base64,{b64}">Download File</a> (right-click and save as <some_name>.csv)'
st.sidebar.markdown(href, unsafe_allow_html=True)
Hi community!
now I can compress A folder , it work
but the download link not working
thanks for help