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

Issue with accept user input. #15

Closed
dmytrodemchenko opened this issue Mar 29, 2019 · 9 comments
Closed

Issue with accept user input. #15

dmytrodemchenko opened this issue Mar 29, 2019 · 9 comments

Comments

@dmytrodemchenko
Copy link

dmytrodemchenko commented Mar 29, 2019

It allows to put any type of files and it seems that it doesn't work properly.

Also, when I use image/* pattern - it shows all visible files in a folder instead of https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_accept

<file-upload ngModel accept="file_extension|audio/*|video/*|image/*|media_type" name="files"></file-upload>
@dmytrodemchenko
Copy link
Author

Why you didn't bind user inputs with an HTML template?

@pIvan
Copy link
Owner

pIvan commented Mar 29, 2019

It is same as file limitation, validator should only validate values and
prepare error objects, you can use them to show user which files are allowed

@dmytrodemchenko
Copy link
Author

Probably, you are not right.
Have you seen the example https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_input_accept ?

Accept uses for avoiding unnecessary files for uploading, also it helps to user pick up the right format file from the bunch of files - and it works properly in an example above.

@pIvan
Copy link
Owner

pIvan commented Mar 29, 2019

You're right. Thank's @dmytrodemchenko beacuse you have noticed it.
Should be implemented in the next few days

@dmytrodemchenko
Copy link
Author

dmytrodemchenko commented Mar 29, 2019

I do not use accept attr as a validator - the main idea to clean a folder from unnecessary files as it provided by official docs.

Everything that you need to do:

 <input #inputRef type="file" **[accept]='acceptInput'** class="files-input" tabindex="-1" multiple (change)="onInputChange($event)">

Please let me know what do you think about this?

@dmytrodemchenko
Copy link
Author

dmytrodemchenko commented Mar 29, 2019

@pIvan thank you a lot for your collaboration.

I'll be looking forward to a new release.

@pIvan
Copy link
Owner

pIvan commented Apr 1, 2019

Support for native accept attribute was added.

It is possible to use it as attribute on <file-upload accept="..."> || <file-upload [accept]="...">
or if you use FileUploadControl as FileUploadControl.acceptFiles(...string).

@pIvan
Copy link
Owner

pIvan commented Apr 2, 2019

I guess we can close this.

@pIvan pIvan closed this as completed Apr 2, 2019
@dmytrodemchenko
Copy link
Author

@pIvan thank you a lot for that!

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

2 participants