Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max size validator with multiple option #73

Open
ruisilva450 opened this issue Dec 29, 2020 · 0 comments
Open

Max size validator with multiple option #73

ruisilva450 opened this issue Dec 29, 2020 · 0 comments

Comments

@ruisilva450
Copy link

ruisilva450 commented Dec 29, 2020

For context, right now if we put a limit of 5mb on the overall selection like this:

<ngx-mat-file-input multiple [formControl]="form"></ngx-mat-file-input>
------------------------
form = formBuilder.control(null, { validators: [ FileValidator.maxContentSize(5242880 /* 5 MB (=5 * 2 ** 20)*/) ] });

It would be nice if we had the option to say the max size for each file when we have the multiple option as true.
Maybe something like this?

form = formBuilder.control(null, { validators: [ FileValidator.maxContentSize(
    bytes: 5242880 /* 5 MB (=5 * 2 ** 20)*/, 
    separate: true
) ] });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant