-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ngf-accept file filtering doesn't seem to work #755
Comments
What is not working? Steps to reproduce |
Well I'm not quite sure how to be more clear than I was since my original post mentioned what isn't working and also mentioned how to reproduce it as well as included a jsfiddle recreating the issue but I'll try explaining it again. In the reference section on the github it mentions the following for ngf-accept: I've tried the following combinations (with and without single quotes just to see if it would make a difference) and none of them filter for the specific file types I listed. When the browser's file select dialog box pops up it still shows all file types instead of just the ones I listed as filters. I created another fiddle for you which is also based off the sample demo fiddle. Hopefully this one makes it more clear what isn't working: |
the browser file popup filter is browser specific and is controlled by |
Ah, ok. I did do some more tinkering around with it after your explanation and I see how it's supposed to work now. The descriptions on the main github page for how to use some of the options in conjunction with the other options are a bit vague. Also it might be helpful to note which ones are required options and which ones are strictly optional. Thanks for the assistance though. I'll go ahead and close out this issue. |
If you have suggestion to make it more clear let me know. |
I do have a few suggestions listed below if you would like to implement them. I would suggest adding a similar note to ngf-select as you did for ngf-drop since not all attributes are required for ngf-select either. For the ngf-accept attribute maybe you could add a comment that says it is used to filter out the files after they have been selected and discards or accepts them based on whether or not they meet the filter criteria. Then on the accept attribute comment you could a small statement that says it is used to filter the files before selection. Doing that would make it really clear that the accept attribute is used to filter files before they are selected and ngf-accept is used to filter files after they are selected. The only other thing I can think of is that it might be a good idea to mention somewhere that by default ng-file-upload won't inform you in any way if a file fails to meet the pattern in ngf-accept. You have to either use ng-model-rejected to see that a file failed or you would need to write your own function that you would pass into ngf-accept to inform you that a file failed. I only mention this because when I was first trying to implement ng-file-upload I kept looking for some kind of informational message in both the browser's debug console and on the page itself to see why my file wasn't getting set in ng-model. |
ngf-accept is case sensitive. it shouldn't. this happened to me on ubuntu. |
@cipianpascu create a separate issue for that. |
Hi Danial, |
From the Readme:
This is very confusing. After reading that I assumed that ngf-accept was a ngf-specific way to get the functionality of the normal "accept" attribute. Only after a bunch of googling did I stumble on this issue and found your explanation of what it actually is. |
@default0 Same here, +1. |
Yes, VERY confusing. Wasted an hour on this. |
I've noticed that ngf-accept doesn't seem to work when you try to use it to filter for specific files. Even on the jsfiddle demo if you change the accept attributes over to ngf-accept the filtering no longer works. You can see this in jsfiddle http://jsfiddle.net/3t50b3fw/401/ for example.
This issue happens to me in Chrome, Firefox, and Internet Explorer.
The text was updated successfully, but these errors were encountered: