What happens if I do not specify the contentLenght header when sending an HttpResponse containing a zip file.
I did some tests and it seems that the header is set by default with the correct file length. Can I be sure that this always happens. When can I find the documentation?
this is the most important part of the code:
response.setContentType("application/zip");
response.addHeader("Content-disposition", "attachment; filename=" + zipFileName);
zos.close();
out.close();
response.flushBuffer();
Davide
source
share