You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Andreas Andreou <an...@di.uoa.gr> on 2005/10/06 16:14:22 UTC

Accept validator for Upload component

Hi all,
would you be interested in adding to Tapestry a validator (to be used 
with the Upload component)
that only allows certain file types (extensions) to be accepted.

I've just added one in the user's mailing list, that supports 
client-server side validation.
It can be used like this:
<binding name="validators" value="validators:accept=jpeg-jpg-png-gif"/>

Here are the changes that this would require:

- Create the class org.apache.tapestry.form.validator.Accept in 
framework/src/java
- Create the related unit test 
(org.apache.tapestry.form.validator.TestAccept) in framework/src/test
- Add a static final String in org.apache.tapestry.valid.ValidationStrings
- Add an (error-message) entry in 
org/apache/tapestry/valid/ValidationStrings.properties
- Register the validator with hivemind at 
framework/src/descriptor/META-INF/tapestry.form.validator.xml

I would be glad to provide the diffs for all these changes...





---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org