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 TpRank #388 · 6.5K reputationPosted Aug 29, 2016, 1:01 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 29, 2016, 1:40 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 29, 2016, 1:14 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 29, 2016, 1:22 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 29, 2016, 1:25 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 29, 2016, 1:27 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 29, 2016, 1:36 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Sep 30, 2016, 3:22 AM EDT
Midhun T Phow are you??