127
rated 0 times
[
131]
[
4]
/ answers: 1 / hits: 41014
/ 10 Years ago, sat, august 2, 2014, 12:00:00
I'm using javascript's FileReader and my customized function for reading an JPG-JPEG image,
My problem is that how it's possible to detect the file extension through my code below and give error to user if the file is not JPG-JPEG:
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
alert('image has read completely!');
}
reader.readAsDataURL(input.files[0]);
}
}
More From » jquery