client/js/uploader.basic.api.js
function(fileWrapper, validationDescriptor) {
            var self = this,
                file = (function() {
                    if (fileWrapper.file instanceof qq.BlobProxy) {
                        return fileWrapper.file.referenceBlob;
                    }
                    return fileWrapper.file;
                }()),
                name = validationDescriptor.name,
                size = validationDescriptor.size,
                buttonId = this._getButtonId(fileWrapper.file),
                validationBase = this._getValidationBase(buttonId),
                validityChecker = new qq.Promise();

            validityChecker.then(
                function() {},
                function() {
                    self._fileOrBlobRejected(fileWrapper.id, name);
                });

            if (qq.isFileOrInput(file) && !this._isAllowedExtension(validationBase.allowedExtensions, name)) {
                this._itemError("typeError", name, file);
                return validityChecker.failure();
            }

            if (!this._options.validation.allowEmpty && size === 0) {
                this._itemError("emptyError", name, file);
                return validityChecker.failure();
            }

            if (size > 0 && validationBase.sizeLimit && size > validationBase.sizeLimit) {
                this._itemError("sizeError", name, file);
                return validityChecker.failure();
            }

            if (size > 0 && size < validationBase.minSizeLimit) {
                this._itemError("minSizeError", name, file);
                return validityChecker.failure();
            }

            if (qq.ImageValidation && qq.supportedFeatures.imagePreviews && qq.isFile(file)) {
                new qq.ImageValidation(file, qq.bind(self.log, self)).validate(validationBase.image).then(
                    validityChecker.success,
                    function(errorCode) {
                        self._itemError(errorCode + "ImageError", name, file);
                        validityChecker.failure();
                    }
                );
            }
            else {
                validityChecker.success();
            }

            return validityChecker;
        }
function(fileWrapper, validationDescriptor) {
            var self = this,
                file = (function() {
                    if (fileWrapper.file instanceof qq.BlobProxy) {
                        return fileWrapper.file.referenceBlob;
                    }
                    return fileWrapper.file;
                }()),
                name = validationDescriptor.name,
                size = validationDescriptor.size,
                buttonId = this._getButtonId(fileWrapper.file),
                validationBase = this._getValidationBase(buttonId),
                validityChecker = new qq.Promise();

            validityChecker.then(
                function() {},
                function() {
                    self._fileOrBlobRejected(fileWrapper.id, name);
                });

            if (qq.isFileOrInput(file) && !this._isAllowedExtension(validationBase.allowedExtensions, name)) {
                this._itemError("typeError", name, file);
                return validityChecker.failure();
            }

            if (!this._options.validation.allowEmpty && size === 0) {
                this._itemError("emptyError", name, file);
                return validityChecker.failure();
            }

            if (size > 0 && validationBase.sizeLimit && size > validationBase.sizeLimit) {
                this._itemError("sizeError", name, file);
                return validityChecker.failure();
            }

            if (size > 0 && size < validationBase.minSizeLimit) {
                this._itemError("minSizeError", name, file);
                return validityChecker.failure();
            }

            if (qq.ImageValidation && qq.supportedFeatures.imagePreviews && qq.isFile(file)) {
                new qq.ImageValidation(file, qq.bind(self.log, self)).validate(validationBase.image).then(
                    validityChecker.success,
                    function(errorCode) {
                        self._itemError(errorCode + "ImageError", name, file);
                        validityChecker.failure();
                    }
                );
            }
            else {
                validityChecker.success();
            }

            return validityChecker;
        }
function ( fileWrapper , validationDescriptor ) { var self = this , file = ( function ( ) { if ( fileWrapper . file instanceof qq . BlobProxy ) { return fileWrapper . file . referenceBlob ; } return fileWrapper . file ; } ( ) ) , name = validationDescriptor . name , size = validationDescriptor . size , buttonId = this . _getButtonId ( fileWrapper . file ) , validationBase = this . _getValidationBase ( buttonId ) , validityChecker = new qq . Promise ( ) ; validityChecker . then ( function ( ) { } , function ( ) { self . _fileOrBlobRejected ( fileWrapper . id , name ) ; } ) ; if ( qq . isFileOrInput ( file ) && ! this . _isAllowedExtension ( validationBase . allowedExtensions , name ) ) { this . _itemError ( "typeError" , name , file ) ; return validityChecker . failure ( ) ; } if ( ! this . _options . validation . allowEmpty && size === 0 ) { this . _itemError ( "emptyError" , name , file ) ; return validityChecker . failure ( ) ; } if ( size > 0 && validationBase . sizeLimit && size > validationBase . sizeLimit ) { this . _itemError ( "sizeError" , name , file ) ; return validityChecker . failure ( ) ; } if ( size > 0 && size < validationBase . minSizeLimit ) { this . _itemError ( "minSizeError" , name , file ) ; return validityChecker . failure ( ) ; } if ( qq . ImageValidation && qq . supportedFeatures . imagePreviews && qq . isFile ( file ) ) { new qq . ImageValidation ( file , qq . bind ( self . log , self ) ) . validate ( validationBase . image ) . then ( validityChecker . success , function ( errorCode ) { self . _itemError ( errorCode + "ImageError" , name , file ) ; validityChecker . failure ( ) ; } ) ; } else { validityChecker . success ( ) ; } return validityChecker ; }
Performs some internal validation checks on an item, defined in the `validation` option.

@param fileWrapper Wrapper containing a `file` along with an `id`
@param validationDescriptor Normalized information about the item (`size`, `name`).
@returns qq.Promise with appropriate callbacks invoked depending on the validity of the file
@private
Performs some internal validation checks on an item defined in the validation option .