accept=”image/*”

OR

 

var extension = input.files[0].name.split(‘.’).pop().toLowerCase(); //file extension from input file

var fileExtension = [‘jpeg’,’jpg’,’png’,’gif’,’bmp’,’JPEG’,’JPG’,’PNG’,’GIF’,’BMP’];

if (jQuery.inArray(extension, fileExtension) == -1)

{

alert(“Only .jpeg .jpg .png .gif .bmp formats are allowed.”);

return false;

}

Leave a Reply