danialfarid / ng-file-upload

Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support
MIT License
7.87k stars 1.6k forks source link

ngfMaxTotalSize and keep='true' #1958

Open DarthBender opened 7 years ago

DarthBender commented 7 years ago

Hello, I'm trying to set 10 MB limit as a max total size, while allowing users to add files with keep='true'. Validation works fine if files were uploaded in one go, but if they were added one by one it doesn't work (so my ngModel total size is greater than limit) . Is it expected behavior?

junminstorage commented 6 years ago

the ngFileUpload doesn't prevent that, it is up to your controller is check the total size of all of the files being uploaded.

you can hook up check fn like below:

ngf-change="dragAttachments($files, $file, $newFiles)"