-
1. Re: Display Error messages in Rich:FileUpload For Unsupported file type.
ilya_shaikovsky Nov 10, 2010 3:07 PM (in response to buffe)http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_fileUpload.html - there you could find entries object check how to access object from list and how to get fileName. you could use fileName(returns full name where you could get extension) for html and fileType(mime type) for Flash. use it in onupload for check and return false if need to abort uploads.
e.g.
onupload="alert(#{rich:component('upload')}.entries[0].fileName); return false;"
that prints filename and abort upload for me.
-
2. Re: Display Error messages in Rich:FileUpload For Unsupported file type.
buffe Nov 11, 2010 2:47 AM (in response to ilya_shaikovsky)Thanks, Ilya, The file is not uploading if the file type is not supported since I have put acceptedTypes="jpg, gif, png" attribute. What I want is to display an error message if some one uploads files other than these types.
-
3. Re: Display Error messages in Rich:FileUpload For Unsupported file type.
j4y Jan 4, 2011 4:53 PM (in response to buffe)how about this:
ontyperejected="alert('File type is invalid');"