You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Chandan Khandelwal (Jira)" <ji...@apache.org> on 2026/07/31 09:20:00 UTC
[jira] [Created] (OFBIZ-13473) UtilHttp file upload fails for files > 2GB with ViewHandlerException: Cannot read more than 2,147,483,639 into a byte array
Chandan Khandelwal created OFBIZ-13473:
------------------------------------------
Summary: UtilHttp file upload fails for files > 2GB with ViewHandlerException: Cannot read more than 2,147,483,639 into a byte array
Key: OFBIZ-13473
URL: https://issues.apache.org/jira/browse/OFBIZ-13473
Project: OFBiz
Issue Type: Improvement
Components: framework
Reporter: Chandan Khandelwal
Uploading files larger than 2GB in OFBiz fails with the following exception: org.apache.ofbiz.webapp.view.ViewHandlerException: Cannot read more than 2,147,483,639 into a byte array
Root Cause: In UtilHttp.java (line 298), multiPartMap.put(fieldName, ByteBuffer.wrap(item.get())) calls item.get() on Commons FileUpload DiskFileItem for every uploaded file.
Java byte arrays are capped at Integer.MAX_VALUE minus 8 bytes overhead, which equals 2,147,483,639 bytes (~2.00 GB). Uploading files larger than this limit throws an IllegalArgumentException, which OFBiz catches and wraps into ViewHandlerException.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)