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

After a file has been added to the queue and then removed, the same file cannot be added again. #322

Closed
ventres opened this issue Dec 10, 2014 · 7 comments

Comments

@ventres
Copy link

ventres commented Dec 10, 2014

This has been tested in Chrome and Safari and can be seen in the simple example provided on your site:
http://nervgh.github.io/pages/angular-file-upload/examples/simple/
Simply add an item, remove it, and add it again.

I believe it is necessary to reach back into the input file element that the directive is attached to and remove the item from the selection. That is what is preventing the file from being added again.

@EmanH
Copy link

EmanH commented Dec 10, 2014

This problem only occurs with 'single' file inputs. Add the multiple attribute and it doesn't happen. I found the same problem last week when I was working with it.
This works fine.
<input type="file" nv-file-select uploader="uploader" multiple />

This doesn't
<input type="file" nv-file-select uploader="uploader" />

@ventres
Copy link
Author

ventres commented Dec 10, 2014

Thanks for the help. Adding multiple does indeed fix it, and with queueLimit set to one, that is a perfectly reasonable fix for now.

@fabiokiatkowski
Copy link

I think that it isn't a problem, if you select just one file so you won't need to clear the INPUT.

But to solve this 'problem', I create an FileUploadOption and set it to true when create the instance of FileUpload.

And added in isEmptyAfterSelection prototype the verification if your new option is true or false.

Maybe I should send a PR about this.

@raoulus
Copy link

raoulus commented Feb 16, 2015

I am having the same problem. Please take a look at my pull request (#357), which fixes this issue.

It uses an extra option as @fabiokiatkowski proposed.

@kunal999
Copy link

kunal999 commented Sep 3, 2015

+1

1 similar comment
@bmustata
Copy link

bmustata commented Oct 5, 2015

+1

@nervgh
Copy link
Owner

nervgh commented Oct 5, 2015

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

7 participants