Reputation: 85
I am using danialfarid/ng-file-upload plugin ,I set the ngf-select directive to .doc,.pdf extension. Its working fine.
Problem is if a user select .png or jpg file, I want to show an alert box to user that this file type are not accepted. Thanks for in advance.
Upvotes: 1
Views: 3059
Reputation: 4098
Something like this:
<div ngf-select ngf-pattern="'.png,.jpg'" ng-model="file">
<div class="alert" ng-show="file.$error === 'pattern'">file type is not accepted. Acceptable files: {{file.$errorParam}}</div>
Upvotes: 2