Skip to content

If I Limited Queue to 1, It has some terrible problem #640

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

Closed
wujiangwei opened this issue Jun 4, 2016 · 4 comments
Closed

If I Limited Queue to 1, It has some terrible problem #640

wujiangwei opened this issue Jun 4, 2016 · 4 comments

Comments

@wujiangwei
Copy link

------ I limit the queue number to 1

  1. When I first selected Image(Called A)
    2.Then I selected Image again(Called B,not A)

then I submit img,My server receive Image A,not B

And I think,Can you support auto replace logic or same other amazing methods

Still,I see your doc and demo
If I user clear first(need a delete button),Then no issue
But I think this is not a good method

Waiting ~

@gabrielliwerant
Copy link

Part of the problem is that "single" upload continually adds files to the queue each time you use it, so if you're attempting to send only one file, you have some complicated logic to figure out which one is the one you need to send. I attempted to work around this locally by clearing the queue after a successful file upload, but this leads to another problem that is evident on the demo page (http://nervgh.github.io/pages/angular-file-upload/examples/simple/):

  1. Upload a single file
  2. Remove all
  3. Upload a single file with the same name

This flow is broken. Nothing is uploaded on step 3 when the file name is the same as the one previously entered. and the "onAfterAddingFile" callback does not fire.

Basically, the flow for using the "single" upload just doesn't seem to work properly. I would expect this feature not to make use of a queue system at all and operate as many current examples of file uploads do on the web when there is only a single file to upload.

@JakeLunn
Copy link

Even destroying the uploader and recreating it does not allow you to select the same file. You have to reload the page entirely.

@vaibhav-jain
Copy link

I had the same problem this is what I did.
Fetched the last uploaded photo as this is what user intended to do.
var latestPhoto = uploader.queue[uploader.queue.length - 1]; and then uploaded by latestPhoto.upload()

@nervgh
Copy link
Owner

nervgh commented Jul 5, 2016

I hope that comment help you.

@nervgh nervgh closed this as completed Jul 5, 2016
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

5 participants