My app is a tender document system where each tender number has one or more pdf files attached.
application is done in java ee using struts and mysql.
in a database table the paths of each related pdf file for a tender number is stores.
I want to get all the pdf files and create a single ZIP file for each tender number so that user can download that zip file and have all the related documents in a single click.
I tried Google and found something called ZipOutputStream
but i cannot understand how to use this in my application.
Checkout this code, here you can easily create a zip file directory:
You're almost there... This is a small example of how to use
ZipOutputStream
... let's asume that you have a JAVA helper H that returns database records with pdf file paths (and related info):