Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It runs on an internal combustion engine. This ad does not:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic