Hi Isomorphic. I have a binary field for which I want to add two validations, one for a maximum size and the other to avoid the file upload to start when no file has been selected. Here is my code:
But it won't allow me to process any files, not even 2KB files. I guess the problem must be related to setting the validator value for the maxFileSize (although the docs here say that the validations will be made against the DataSourceField.maxFileSize, which I have defined properly (I think).
I tried removing the "required" validator, but it didn't work either. Removing the "maxFileSize" validator results in the "required" validator working correctly, and also the "maxFileSize" being imposed properly, but the error message for the maximum file size is (as expected) not displayed in the proper user locale.
Can you please help me with this validation?
Thanks
Code:
<field name="bankfile" type="binary" maxFileSize="20971520"> <title><fmt:message key="bankload_loadFile"/></title> <validators> <validator type="maxFileSize"> <errorMessage><fmt:message key="bankload_fileSizeInvalid"/></errorMessage> </validator> <validator type="required"> <errorMessage><fmt:message key="bankload_noFileSelected"/></errorMessage> </validator> </validators> </field>
I tried removing the "required" validator, but it didn't work either. Removing the "maxFileSize" validator results in the "required" validator working correctly, and also the "maxFileSize" being imposed properly, but the error message for the maximum file size is (as expected) not displayed in the proper user locale.
Can you please help me with this validation?
Thanks
Comment