Pages

Sunday 2 February 2014

How to Check File Size before Upload or Get Image Size before Upload using jQuery

How to  Check File Size before Upload or Get Image Size before Upload using jQuery



$("#<%=upload1.ClientID %>").fileUpload({
 'uploader': 'scripts/uploader.swf',
 'cancelImg': 'cancel.png',
 'buttonText': 'Select Files',
 'script': 'Handler.ashx',
 'folder': 'images',
 'fileDesc': 'Image Files',
 'fileExt': '*.jpg;*.jpeg;*.gif;*.png', 'multi': true,
 'auto': true,
 'sizeLimit': (200 * 1024),
 //200 KB onError: function (a, b, c, d)
 {
 if (d.type === "File Size")
 {
 $("#lblmsg").html('File Size Should not exceed 200 KB');
 }
 }, onComplete: function ()
 {
 $("#lblmsg").html('');
 }
 });








No comments:

Post a Comment