Skip to content
← Back to Community
How to make a zip file download button in html?
Profile icon
Aarushiswinnery

I wanted to know how to make the button to download button with zip file as I am making a site with a lot of python codes(by me) compressed in a zip and be downloadable.
Please help me as I have been stuck on this question for months and I haven't found the solution yet.

Comments
hotnewtop
Profile icon
matthyno

Have you tried something like this?

<button onclick="window.location='./test.zip'">Download Zip</button>

If you're using Flask, you should be able to throw Python variables inside of HTML code, to have an adjustable ZIP download.

Profile icon
Aarushiswinnery

@cjmatthy09 Thanks bro, will try the code

Profile icon
Aarushiswinnery

@cjmatthy09 It didn't work bro

Profile icon
matthyno

can you send me your code/repl? @Aarushiswinnery