Possible Duplicate:
Check file input size with jQuery
i need to check the uploaded image size is less than 5mb
i using the following code
$("#fileUpload").change(function () {
$file = $("#fileUpload");
var a = $file[0];
var iSize = ($file[0].files[0].size / 1024);
if (iSize / 1024 > 1) {
iSize = (Math.round((iSize / 1024) * 100) / 100)
alert('file size is ' + iSize);
if (iSize > 5) {
$('#FileImageSizeValidation').show();
}
}
});
in that, i got the undefined error on $file[0].files[0]. it shows error in this line. how to do this.
thanks pooja