FileUploadFilter fails when browser sends to big a file.

UI Components for JSF
Post Reply
markus.kobold
Posts: 9
Joined: 12 Jan 2012, 02:06

12 Jan 2012, 02:22

Specifically in firefox if a user uses the file upload component in version 3.0 and uploads a file bigger than 2GB the the primefaces servlet filter does not handle the stream processing error gracefully. This is kind of an issue in the sense that there is no way to notify the user that upload didn't happen even when using the growl component to be updated there is still no indication to the user that something went wrong.


Here is the steps i have done to reproduce this problem.
  • Use the UNIX command 'mkfile 3g big-test-file.bin' to create an empty but large file to upload.
  • Use the following code snippet : (Assuming more 'reasonable' file sizes work)

    Code: Select all

     <p:fileUpload mode="advanced" multiple="true" fileUploadListener="#{attachmentController.handleAttachmentUpdate}" label="Add Attachment" update="messages" auto="true" />
     <p:growl id="messages"  showDetail="true"/>
    
  • Upload the file using the respective web page and it results in the following exception on the server side with no client side indication that something bad happened.
    SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/web-app] threw exception
    java.io.IOException: Processing of multipart/form-data request failed. Stream ended unexpectedly
    at org.primefaces.webapp.MultipartRequest.parseRequest(MultipartRequest.java:69)
    at org.primefaces.webapp.MultipartRequest.<init>(MultipartRequest.java:51)
    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:72)
I would like to be able to handle this error gracefully when the browser doesn't send my application a file correctly. I would also note that IE exhibits the same behavior but without the server side exception for files greater than 2 GB. Chrome and Safari seem to be able to actually upload large files of at least 6 GB with no issue using primefaces.

Please advise.

nikagra
Posts: 8
Joined: 01 Dec 2011, 15:56

04 Apr 2012, 10:53

Any ideas? I also have same error (in PrimeFaces 3.0.1) even when uploading 300mb file.

My web.xml:

Code: Select all

	<!-- PrimeFaces file upload -->
	<filter>
		<filter-name>PrimeFaces FileUpload Filter</filter-name>
		<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
		<init-param>
			<description>Maximum size of stored in memory file</description>
			<param-name>thresholdSize</param-name>
			<param-value>1024</param-value>
		</init-param>
	</filter>

dear-rihab
Posts: 1
Joined: 13 Jun 2012, 10:13

13 Jun 2012, 10:21

I have the same problem. with Firefox, I can upload 2G but with 3G it fails. With Chrome, It Works for 3G but with 5G I have noticed a loop when uploading (2 upload for the same file have been done and it freeze after).

I'm using primefaces 3.2 with a Tomcat 7.

Any help :)?
Thnx

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 44 guests