This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Tried to zip multiple files on the fly in javaservlet with zip package (ZipOutputStream), so users can download the zip file by calling the servlet. It works fine for small files. But occasionally the browser stops the download before completion when users invoke the servlet action, and the zip file downloaded is corrupted.
The servlet response header �content length� is not set, since the zip file is generated on the fly and we don�t know the size. �Transfer-Encoding� is set to �chunked� to resolve the dynamic content length: