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

ng-accept does not work with comma separated wildcard and multiple files #658

Closed
soerface opened this issue Apr 6, 2015 · 6 comments
Closed

Comments

@soerface
Copy link

soerface commented Apr 6, 2015

According to the docs, ng-accept accepts a comma separated list of file extensions:

ng-accept="'.pdf,.jpg'|validate($file)" // function or comma separated wildcard to filter files allowed

It does work, but using this syntax does not allow multiple file uploads anymore. Steps to reproduce:

  • Go to https://angular-file-upload.appspot.com/
  • In the "Play with attributes" section, enable ng-multiple
  • As ng-accept value, enter .jpg,.png
  • Drag and drop multiple files into the box. It will only upload one of them, the other ones are not even displayed as “rejected”. The filter rule itself is working (only png and jpg allowed).

Tested with Chromium Version 41.0.2272.76 Ubuntu 14.04 (64-bit) and Firefox 37.0

@danialfarid
Copy link
Owner

you meed to set ng-multiple to true.

@soerface
Copy link
Author

soerface commented Apr 8, 2015

I did checked that box, see step 2 in my list. Just changing the ng-accept value back to image/* makes it work again.

danialfarid pushed a commit that referenced this issue Apr 13, 2015
…and some IE8-9 bugs and styling issue
@danialfarid
Copy link
Owner

Fixed in version 3.3.0

@gottfrois
Copy link

It's working for drag and drop but not when selecting files from the input button. Looking at the web console there is a parse error showing up: http://jsfiddle.net/mut7cevm/1/

@danialfarid
Copy link
Owner

ng-accept="'.txt'"

@gottfrois
Copy link

oh man sorry about 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

3 participants