show alert box when user select non accepted file in danialfarid/ng-file-upload plugin

Issue

  • 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.

Solution

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>

Answered By – danial

Answer Checked By – Gilberto Lyons (AngularFixing Admin)

Leave a Reply

Your email address will not be published.