0

I need one help.I need keep limit of selecting files using ng-file-upload in Angular.js.I am explaining my code below.

<input
  type="file"
  class="filestyle form-control"
  data-size="lg"
  name="bannerimage"
  id="bannerimage"
  ng-model="file"
  ngf-pattern="'image/*'"
  accept="image/*"
  ngf-max-size="2MB"
  ngf-min-height="100"
  ngf-resize="{width: 100, height: 100}"
  custom-on-change="uploadFile"
  required="required"
  ngf-select="onFileSelect($file);"
  ngf-multiple="true"
>

Here i have multiple file selecting scenario but i need user can only select maximum 5 files after that it can not select any file.Please help me.

1
  • Upgrade to 11.1.0 and use ngf-max-files="10" Commented Jan 13, 2016 at 18:20

1 Answer 1

0

What about the attribute ngf-select-disabled

With a condition like "myFiles.length > 5" ?

You could add ngf-drop-disabled too if te user can use drag and drop.

https://github.com/danialfarid/ng-file-upload

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.