I am writing a web server in java that is transferring file upto 2GB fine. When I searched for the reason, I found like java HttpServelet only allows us to set the content l
You can also use below sample code.
long length = fileObj.length(); if (length <= Integer.MAX_VALUE) { response.setContentLength((int)length); } else { response.addHeader("Content-Length", Long.toString(length)); }