You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release 4.2 added support for per-file size limits — task #17792.
The new method is CommonsFileUploadSupport.setMaxUploadSizePerFile(long).
But this setting has no effect if file encoding does not match default encoding.
The reason is the following code in CommonsFileUploadSupport:
protectedFileUploadprepareFileUpload(Stringencoding) {
FileUploadfileUpload = getFileUpload();
FileUploadactualFileUpload = fileUpload;
// Use new temporary FileUpload instance if the request specifies// its own encoding that does not match the default encoding.if (encoding != null && !encoding.equals(fileUpload.getHeaderEncoding())) {
actualFileUpload = newFileUpload(getFileItemFactory());
actualFileUpload.setSizeMax(fileUpload.getSizeMax());
// !!missing: actualFileUpload.setFileSizeMax(fileUpload.getFileSizeMax());actualFileUpload.setHeaderEncoding(encoding);
}
returnactualFileUpload;
}