how to add a validation in fileuploader during fileuploader onchange method it will accept only images with image preview???
I have a fileuploader in asp.net c#..I have already made a javascript function during fileuploader onchange method for image preview...
Here is my code for fileuplader
Here is my javascript code for imagepreview
function showimagepreview(input) {
debugger
if (input.files && input.files[0]) {
var filerdr = new FileReader();
filerdr.onload = function (e) {
$('#imgprvw').attr('src', e.target.result);
}
filerdr.readAsDataURL(input.files[0]);
}
}
Every thing is working fine..My problem is that i want to add a validation that
uploaded file only accept images not other file..how to modified my javasscript code that it will only accept images..if we will choose other file then fileuploader will become empty...can any one help me please??
Midhun TpPosted Aug 29, 2016, 5:01 AM
Manoj MaharanaPosted Sep 30, 2016, 7:22 AM
Midhun T Phow are you??
Midhun TpPosted Aug 29, 2016, 5:40 AM
Manoj MaharanaPosted Aug 29, 2016, 5:36 AM
Manoj MaharanaPosted Aug 29, 2016, 5:27 AM
Midhun TpPosted Aug 29, 2016, 5:25 AM
Midhun TpPosted Aug 29, 2016, 5:22 AM
Manoj MaharanaPosted Aug 29, 2016, 5:14 AM