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

Bug: uppy.AddFile() cancels previous upload #1345

Closed
Aarbel opened this issue Mar 12, 2019 · 2 comments
Closed

Bug: uppy.AddFile() cancels previous upload #1345

Aarbel opened this issue Mar 12, 2019 · 2 comments

Comments

@Aarbel
Copy link
Contributor

Aarbel commented Mar 12, 2019

Expected behavior

I want to allow my users to make parallelized uploads.
That means:

  1. if a user goes on a page and uploads a big file TEST BIG FILE.mp4 (90 Mo)
  2. then goes on an other page and uploads an other file TEST SMALL FILE.png (500 Ko) (but the big file isn't fully uploaded)
  3. The two files will be uploaded

Bad behavior

Uppy instance keeps TEST BIG FILE.mp4in its state, but doesn't upload it. Only TEST SMALL FILE.png is uploaded.
image
At this step the Status Bar show that :
image
image

To reproduce

const uppy = Uppy({
	autoProceed: true,
	allowMultipleUploads: true,
	restrictions: {
        maxFileSize: TEN_GIGA_BYTES,
        maxNumberOfFiles: null,
        minNumberOfFiles: null,
        allowedFileTypes: null,
    });

uppy
  .use(AwsS3, {
	id: 'AwsS3',
    limit: 0,
	getUploadParameters: 
  })
  .on('upload-success', (file, response) => {
     console.log('upload-success File :', file);
  })
  .on('complete', (result) => {
	uppy.reset();
  })
let file
/* The file object will come from an input. Will be TEST BIG FILE.mp4 and TEST SMALL FILE.png.
   This function is triggered two times */
uppy.addFile({
	name: file.name,
    type: file.type,
    data: file,
    source: 'Local',
    isRemote: false,
})

Do you know how to fix it ?

@Aarbel
Copy link
Contributor Author

Aarbel commented Mar 12, 2019

Core problem is here:

image
Uppy seems to be fully cleaned when the TEST SMALL FILE.png has finished

@Aarbel
Copy link
Contributor Author

Aarbel commented Mar 12, 2019

Ok found the origin of the problem.

uppy.on('complete') 

is fired for each upload, so my reset() function was trigerred at the end of the second file upload.

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

1 participant