Custom Client-Side Validation

Demo uploads land in a temporary store and are swept after 60 minutes. To keep files, handle FileUploaded — see Single File for the complete save pattern.
Custom Client-Side Validation

Implement any custom validation logic in the onSelect callback. This example rejects files with spaces in the name and requires a naming convention.

What you should see: your own validation function runs per file at selection time - rules the built-in validators do not cover.
AjaxUploader.create(element, {
 onSelect: function (file) {
 if (/\s/.test(file.name)) {
 showValidationMessage('Filenames must not contain spaces.');
 return false;
 }
 if (!/^[a-zA-Z]/.test(file.name)) {
 showValidationMessage('Filename must start with a letter.');
 return false;
 }
 return true;
 }
});