aspose file tools*
The moose likes JSF and the fly likes How to enable the user to upload a new File using rich:fileUpload on maximum file size reached error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to enable the user to upload a new File using rich:fileUpload on maximum file size reached error" Watch "How to enable the user to upload a new File using rich:fileUpload on maximum file size reached error" New topic
Author

How to enable the user to upload a new File using rich:fileUpload on maximum file size reached error

Sudha Ramasamy
Greenhorn

Joined: May 05, 2011
Posts: 10
Hi,
I want to upload a file using rich:fileupload component, I've configured maximum file size in web.xml seam Filter configuration like the following
<filter>
<filter-name>Seam Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
<init-param>
<param-name>createTempFiles</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>maxRequestSize</param-name>
<param-value>262144</param-value>
</init-param>
</filter>

so when the uploaded file reached the maximum size, file upload will be aborted and the 'maximum file size reached' error is displayed in the UI, but in order to enable the user to upload a new file I had to reRender the panel where my rich:uploadfile component is, I'm doing that reRender in onuploadcomplete event, but this event gets triggered regardless of whether or not the fileUpload is aborted due to maximum isze reached error occurred. so on doing reRender when the error has occurred, the error message will disappear before even the user gets the chance to see the error,
Is there a way to listen to file upload aborted event? or how to enable the user to upload a newFile using rich:fileUpload without reRendering?

If I don't do the validation through seam filter, I can configure it in components.xml and read the configuration in components.xml using java code in server side and display custom error message.
<web:multipart-filter create-temp-files="true"
max-request-size="1000000"
url-pattern="*.seam"/>

But I don't know how to read the configuration in components.xml in server side.
Do anyone know how to solve this issue ?

Thanks,
Sudha
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to enable the user to upload a new File using rich:fileUpload on maximum file size reached error
 
Similar Threads
Error in First Hibernate Example
hibernate 4 and spring 3.1.2 issue with LocalSessionFactoryBuilder
java.io.FileNotFoundException: Too many open files
Step by steyp JNDI look up with jboss 7.1
How to Enable SSL on Tomcat 7 on Linux?