How to detect the uploaded file type in angularJS
Modern browsers have File API support.
$scope.uploadFile = function(files) {
files[0].type; //MIME type
files[0].size; //File size in bytes
};
Here is a list of image MIME types
I would recommend to already specify the files you would like to accpet within your input
tag like so:
<input type="file" name="files" accept="image/*">
For more information check out the W3Schools reference for the input tag.