i am using valmus script and i can not validate the dimension of the image on submit. it only validates the regex parts... I want a 800px width and 400px height image validation on submit.. Or in handler what else i can do?

new AjaxUpload('imageUpload', {
            action: '../Handler.ashx',
            name: 'myFile',
            onSubmit: function (file, ext) {
                $('div.preview').addClass('loading');

                var onlyFileName = file.split('.')[0];

                var excludeChars = new RegExp("[~#%&*{}<>;:?/+|\"]");
                if (!(ext && /^(jpg|png)$/i.test(ext) && excludeChars.test(onlyFileName))) {
                    alert('File name should not contain special characters');
                    return false;
                }

                if ($(this).Width < 800 && $(this).Height < 400) {
                    alert('File should be 800px width and 400px height');
                    return false;
                },
  onComplete: function (file, response) {
                thumb.load(function () {
$('div.preview').addClass('loading');
                     thumb.unbind();
                });
                  }
        });

Related posts

Recent Viewed