[ 
https://issues.apache.org/jira/browse/FILEUPLOAD-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12531741
 ] 

Stepan Koltsov commented on FILEUPLOAD-148:
-------------------------------------------

No, I want to limit data allowed to be loaded into memory.

I want limit files to 200M and limit size of data in memory to 20K, and I want 
to avoid explicit checking of getSize() each time before calling getString().

Even better, FileItem.get() should throw exception if file is exceeds some 
parameter.

Point is to deny loading large files into memory from FileItem.get() method.

Currently, calling of 200M FileItem.get() (or getString()) causes 
OutOfMemoryError.

> FileItemFactory.setMaxStringLength()
> ------------------------------------
>
>                 Key: FILEUPLOAD-148
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-148
>             Project: Commons FileUpload
>          Issue Type: New Feature
>    Affects Versions: 1.2
>            Reporter: Stepan Koltsov
>
> Need method
> FileItemFactory.setMaxStringLength(int limitInBytes)
> When this parameter is set, calling of FileItem.getString() when getSize() 
> exceeds limitInBytes should throw Exception. This is required to avoid OOME 
> in case of wrongly submitted forms (i. e. when bad guy puts big file into the 
> form field "fileDescription").
> Or even better sizeThreshold should be used for this value.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to