I'm looking for a client side validator for input type="file" to validate file names/extensions.
I know this is possible with jQuery validation, but would be nice to have this working as a validation attribute.
I'm looking for a client side validator for input type="file" to validate file names/extensions.
I know this is possible with jQuery validation, but would be nice to have this working as a validation attribute.
You are asking for a client side validation but you are referreing to a validation attribute which is a server side validation.
You should be validating submit on a client with jQuery and then on a server. Also do you really need an attribute for validating a file upload? How many action methods do you have that will be used for a file upload?
RequiredAttribute that generate client side validation by virtue of jQuery unobtrusive validation (hint - they are the same). In response to your question I have 5 different actions that allow file uploads, some that have multiple files. Therefore, an attribute will save a lot of duplication.