You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Yoel Benharrous (Commented) (JIRA)" <de...@myfaces.apache.org> on 2011/10/12 12:03:11 UTC

[jira] [Commented] (TOMAHAWK-1381) HtmlInputFileUpload does not fail gracefully when filesize exceeds uploadMaxFileSize web.xml value

    [ https://issues.apache.org/jira/browse/TOMAHAWK-1381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13125700#comment-13125700 ] 

Yoel Benharrous commented on TOMAHAWK-1381:
-------------------------------------------

I'm woking with tomahawk 20 1.1.10 and JSF 2 (Mojjarra) and my configuration in my web.xml is:

<filter>
		<filter-name>MyFacesExtensionsFilter</filter-name>
		<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>	
	    <init-param>
		   <param-name>cacheFileSizeErrors</param-name>
		   <param-value>true</param-value>
		</init-param>
	
	    <init-param>
		   <param-name>uploadMaxFileSize</param-name>
		   <param-value>3m</param-value>
		</init-param>
		<init-param>
		   <param-name>uploadMaxSize</param-name>
		   <param-value>15m</param-value>
		</init-param>       
</filter>

If I upload a file of 7m => no error message on the JSF Page.
I think the validation step is bypassed and I don't understand why?


                
> HtmlInputFileUpload does not fail gracefully when filesize exceeds uploadMaxFileSize web.xml value
> --------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-1381
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1381
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: File Upload
>    Affects Versions: 1.1.7, 1.1.8
>            Reporter: Phillip Webb
>            Assignee: Leonardo Uribe
>             Fix For: 1.1.9
>
>         Attachments: TOMAHAWK-1381-fileupload6.patch, file-upload.patch, file-upload2.patch, testUsedForSolveTOMAHAWK1381.zip
>
>
> When uploading a file using the HtmlInputFileUpload that exceeds that uploadMaxFileSize web.xml setting the system fails without error and no form data is not processed by JSF.
> I think that there are a number of reasons for this:
> - There is a bug in commons-fileupload that prevents failures from being handled correctly (see FILEUPLOAD-169)
> - MultipartRequestWrapper calls FileUploads setSizeMax, this is the size for the total upload, and not individual files, it should call setFileSizeMax
> - HtmlFileUploadRenderer calls fileUpload.parseRequest(request), this will fail if any size exceptions are thrown, it would be better to use fileUpload.getItemIterator and catch each exception.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira