You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Hanspeter Dünnenberger (JIRA)" <ji...@apache.org> on 2011/06/14 14:59:52 UTC

[jira] [Created] (FILEUPLOAD-194) conceptual error throwing FileUploadException when upload size or file size exeeds limits

conceptual error throwing FileUploadException when upload size or file size exeeds limits
-----------------------------------------------------------------------------------------

                 Key: FILEUPLOAD-194
                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-194
             Project: Commons FileUpload
          Issue Type: Bug
    Affects Versions: 1.2.2, 1.2.1
            Reporter: Hanspeter Dünnenberger
         Attachments: my-changes.patch

When any size limits exceed, immediately a FileUploadBase.SizeLimitExceededException or FileUploadBase.FileSizeLimitExceededException is thrown and parsing of the multipart request terminates without providing request parameters for further processing.

This basically makes it impossible for any web application to handle size limit exceeded cases gracefully. 

My proposal is that request parsing should always complete to deliver the request parameters. Size limit exceeded cases/exceptions might be collected for later retrieval, FileSizeLimitExeededException should be mapped to the FileItem to allow some validation on the FileItem on application level. This would allow to mark upload input fields as erronous if the uploaded file was too big. 

Actually I made a patch for that (see attachment). With this patch, commons-fileupload always completes request parsing in case of size limit exceedings and only after complete parsing will throw an exception if one was detected. Using FileUploadBase.setThrowUploadException(false) no exceptions will be thrown (except more critical ones like invalid stream format).
After request processing the collected FileUploadExceptions might be retrieved using FileUploadBase.getFileUploadExceptions().

The patch shows the concept, but further improvement might be necessary.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (FILEUPLOAD-194) conceptual error throwing FileUploadException when upload size or file size exeeds limits

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FILEUPLOAD-194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13053189#comment-13053189 ] 

Maurizio Cucchiara commented on FILEUPLOAD-194:
-----------------------------------------------

We (the struts user/developer) are experiencing the same problem. Is there any chance to change the FU behavior? (as struts was designed, it's not acceptable to lose the request parameters) 

> conceptual error throwing FileUploadException when upload size or file size exeeds limits
> -----------------------------------------------------------------------------------------
>
>                 Key: FILEUPLOAD-194
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-194
>             Project: Commons FileUpload
>          Issue Type: Bug
>    Affects Versions: 1.2.1, 1.2.2
>            Reporter: Hanspeter Dünnenberger
>         Attachments: my-changes.patch
>
>
> When any size limits exceed, immediately a FileUploadBase.SizeLimitExceededException or FileUploadBase.FileSizeLimitExceededException is thrown and parsing of the multipart request terminates without providing request parameters for further processing.
> This basically makes it impossible for any web application to handle size limit exceeded cases gracefully. 
> My proposal is that request parsing should always complete to deliver the request parameters. Size limit exceeded cases/exceptions might be collected for later retrieval, FileSizeLimitExeededException should be mapped to the FileItem to allow some validation on the FileItem on application level. This would allow to mark upload input fields as erronous if the uploaded file was too big. 
> Actually I made a patch for that (see attachment). With this patch, commons-fileupload always completes request parsing in case of size limit exceedings and only after complete parsing will throw an exception if one was detected. Using FileUploadBase.setThrowUploadException(false) no exceptions will be thrown (except more critical ones like invalid stream format).
> After request processing the collected FileUploadExceptions might be retrieved using FileUploadBase.getFileUploadExceptions().
> The patch shows the concept, but further improvement might be necessary.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (FILEUPLOAD-194) conceptual error throwing FileUploadException when upload size or file size exeeds limits

Posted by "jagub zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FILEUPLOAD-194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13054211#comment-13054211 ] 

jagub zhang commented on FILEUPLOAD-194:
----------------------------------------

I suggest commons-fileupload can support error handler for parse request.

> conceptual error throwing FileUploadException when upload size or file size exeeds limits
> -----------------------------------------------------------------------------------------
>
>                 Key: FILEUPLOAD-194
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-194
>             Project: Commons FileUpload
>          Issue Type: Bug
>    Affects Versions: 1.2.1, 1.2.2
>            Reporter: Hanspeter Dünnenberger
>         Attachments: my-changes.patch
>
>
> When any size limits exceed, immediately a FileUploadBase.SizeLimitExceededException or FileUploadBase.FileSizeLimitExceededException is thrown and parsing of the multipart request terminates without providing request parameters for further processing.
> This basically makes it impossible for any web application to handle size limit exceeded cases gracefully. 
> My proposal is that request parsing should always complete to deliver the request parameters. Size limit exceeded cases/exceptions might be collected for later retrieval, FileSizeLimitExeededException should be mapped to the FileItem to allow some validation on the FileItem on application level. This would allow to mark upload input fields as erronous if the uploaded file was too big. 
> Actually I made a patch for that (see attachment). With this patch, commons-fileupload always completes request parsing in case of size limit exceedings and only after complete parsing will throw an exception if one was detected. Using FileUploadBase.setThrowUploadException(false) no exceptions will be thrown (except more critical ones like invalid stream format).
> After request processing the collected FileUploadExceptions might be retrieved using FileUploadBase.getFileUploadExceptions().
> The patch shows the concept, but further improvement might be necessary.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (FILEUPLOAD-194) conceptual error throwing FileUploadException when upload size or file size exeeds limits

Posted by "Hanspeter Dünnenberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FILEUPLOAD-194?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hanspeter Dünnenberger updated FILEUPLOAD-194:
----------------------------------------------

    Attachment: my-changes.patch

> conceptual error throwing FileUploadException when upload size or file size exeeds limits
> -----------------------------------------------------------------------------------------
>
>                 Key: FILEUPLOAD-194
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-194
>             Project: Commons FileUpload
>          Issue Type: Bug
>    Affects Versions: 1.2.1, 1.2.2
>            Reporter: Hanspeter Dünnenberger
>         Attachments: my-changes.patch
>
>
> When any size limits exceed, immediately a FileUploadBase.SizeLimitExceededException or FileUploadBase.FileSizeLimitExceededException is thrown and parsing of the multipart request terminates without providing request parameters for further processing.
> This basically makes it impossible for any web application to handle size limit exceeded cases gracefully. 
> My proposal is that request parsing should always complete to deliver the request parameters. Size limit exceeded cases/exceptions might be collected for later retrieval, FileSizeLimitExeededException should be mapped to the FileItem to allow some validation on the FileItem on application level. This would allow to mark upload input fields as erronous if the uploaded file was too big. 
> Actually I made a patch for that (see attachment). With this patch, commons-fileupload always completes request parsing in case of size limit exceedings and only after complete parsing will throw an exception if one was detected. Using FileUploadBase.setThrowUploadException(false) no exceptions will be thrown (except more critical ones like invalid stream format).
> After request processing the collected FileUploadExceptions might be retrieved using FileUploadBase.getFileUploadExceptions().
> The patch shows the concept, but further improvement might be necessary.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira