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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • 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

Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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-name>Seam Filter</filter-name>

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"

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

It runs on an internal combustion engine. This ad does not:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic