How can I check the width and height of an image being uploaded via RadAyncUpload in an asp.net WebForm and then return an error message to the user if it doesn't match my required dimensions? I'm open to client-side or server-side options, just need to get this done.
var _URL = window.URL || window.webkitURL; var fileInput = sender; //get the file from the input field var file = args.get_fileInputField().files[0]; img = new Image(); img.onload = function () { if (this.width < 224 || this.height < 288) validationFailed(sender, "invalid dimension");
if (args == "invalid extension") alert("The file must be a JPG, JPEG, or PNG"); else if (args == "invalid dimension") alert("The image must be at least 224 x 288");
setTimeout(function () {deleteInvalid(sender)}, 250);//wait for the file to actually be added to the async uploads array before trying to delete it } function deleteInvalid(sender) { sender.deleteFileInputAt(0); }