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
Just let it use chunked transfer mode, which is the default. There is no Content-Length header in that circumstance. See @BalusC's comment under this question.