without creating ZIP file on server (hard disk) and give it to client (download)
Joined: Dec 02, 2009
I am having a requirement in which i will let users choose a list of files (using check box) and let him download all the files he selected to download by zipping them and show him the download prompt for Open/Save/Cancel.
I am able to do this by creating the zip file on the server hard disk and making use of this file and let the user to download the files, every thing is going fine. But i don't want to create a zip file on the harddisk, i want to create it on the fly and let user download the zip file, at any point of time there should be no .zip file on my server.
can anyone suggest me how to achieve this, can anyone help me in this regard.
Depending on how large the files are, this may not be a good idea. If the files are megabytes in size, for example, then this will take up a lot of memory and may negatively impact the overall performance of your web application. But if you don't think that this will be a problem, you should be able to accomplish this by passing a ByteArrayOutputStream into the constructor of the output stream object.