The current architecture of my application doesn't allows me to store a file in server side and create the link to that stored file. So is there any other options (or a code snippet) to directly stream the ZipFile and store it at client side ?
Edit: I guess my question has been misinterpreted. I am receiving answers of Zipping the files and store it at client side. I have already achieve that. Below is the main concern with the sample use case:
Scenario: User has got around 5000 records (approx size of 1 MB each) and user want to download the child records( in CSV format) of each 5000 records compressed in ZIP format. All the CSV files are generated on the fly.
Approach: As the size of the ZIP file can be upto 5 GB, so I took the approach of direct streaming the content of files into the ZIP file created at the client side. I have used PipeInputStream and PipeOutputStream for this.
Result: As I am new to vaadin I am not successful in the above approach so looking for any suggestions/ code snippets which supports direct streaming of ZIP file(whatever the size may be) to the client side.
I guess I am now clear.
I can see that the answer has been accepted automatically by the system(NOT by me) as it was voted 3 times. I don't have an issue with that but I don't want to confuse the people who (in case) land up here searching for answer. I appreciate the answer given by @Pratyush Kumar Singh (as it helps you to explore more) but sorry StackOverFlow I can't accept the answer as my question hasn't been answered yet. I am still working on it and will post the answer once I resolved through POC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With