Rahul,

On 1/12/16 10:56 PM, Rahul Singh wrote:
> Hi,
> 
>> Define "Not successful"?  Exceptions thrown?  File truncated?  Upload
>> never starts?  Never finishes?
> 
> Not successful :
> 
> Request Never finishes, we have trace the HttpServlet request object
> and request.getContentLength return 0 in case when file size is >=2GB,
> 
> No exception thrown, as well as when file size is less than 2GB, then
> request.getContentLength return the correct value of file size in
> byte.

ServletRequest.getContentLength is declared to return an int value (32-bit):

* Integer.MAX_VALUE  = 2^31 - 1 = 2147483647
* 2GiB = 2 * 1024 * 1024 * 1024 = 2147483648
* 2147483648 > 2147483647

Therefore, request.getContentLength cannot be used to fetch
content-lengths over 2GiB - 1byte. You have to use
ServletRequest.getContentLengthLong (new in servlet 3.1) or call
HttpServletRequest.getHeader("Content-Length") as a String and parse it
yourself.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to