angular-file-upload icon indicating copy to clipboard operation
angular-file-upload copied to clipboard

Round Robin Upload Queue

Open michaelwsk opened this issue 12 years ago • 3 comments

I'm talking about the following scenario

  1. Use
  2. setting the queue limit to 1, because user only wants to upload one file
  3. User chooses 1 file, but then decides to change it, so he clicks "choose file" button again.

The UI of the element suggests file is changed, but the file uploader doesn't accept the file, since the queue reaches its limit. However, in this case, a round robin will be more desired.

I understand we can use ng-click="clearQueue()", however, this introduces an unnatural behavior. User could click the "choose file" accidentally. The default behavior for tag will allow user to click "cancel" and now to anything, but the click handler will clear the queue preemptively.

michaelwsk avatar Nov 04 '14 18:11 michaelwsk

Round Robin queue would be cool.. I use this workaround with a filter.. (with nothing set for queueLimit). If you set it to 1, the filter doesn't get called.

            $scope.logoUploader.filters.push({
                name: 'overWriteLogoFilter',
                fn: function(item /*{File|FileLikeObject}*/ , options) {
                    if(this.queue.length==1){
                        this.clearQueue();
                    }
                    return true;
                }
            });

SridharSubramaniam avatar Jan 11 '15 07:01 SridharSubramaniam

+1 for what @michaelwsk's is asking. +1 for the workaround by @SridharSubramaniam, thank you!

pulkitsinghal avatar Aug 10 '15 15:08 pulkitsinghal

That's what I was looking for, thx @SridharSubramaniam

ghost avatar Dec 18 '15 21:12 ghost