Coder Social home page Coder Social logo

Comments (5)

kukhariev avatar kukhariev commented on July 2, 2024

more detailed:

if concurrency=2
third call to this action does not set the event.itemOptions

        if (this.concurrency - this.runningProcess() > 0) {
          upload.upload(event.itemOptions);
        } else if (upload.status === ('added' as UploadStatus)) {
          upload.status = 'queue' as UploadStatus;
        }

from ngx-uploadx.

wil92 avatar wil92 commented on July 2, 2024

I think that should be the behavior, if there are currently 2 uploading files and you put a 3rt one, this should wait for start uploading and not start immediately, because the concurrency is 2 and should not be more than 2 uploading at the same time.

For start the pending copies, I subscribe to subj observable and after some uploading finish, and the autoplay is true, then start the pending uploadings

constructor() {
    this.subj.subscribe((uploadState: UploadState) => {
      if (
        uploadState.status === 'complete' ||
        uploadState.status === 'cancelled' ||
        uploadState.status === 'error'
      ) {
        this.autoUploadFiles();
      }
    });
  }

So, when one of the first two copies finish, then the 3th one start uploading

from ngx-uploadx.

kukhariev avatar kukhariev commented on July 2, 2024

to see this bug, in the file selection dialog, select 3 files with the Ctrl key pressed.
third file requests will lose the 'Content-Disposition' header.

//  src/app/service-way/service-way.component.ts

        const cfg: UploadItem = {
          headers: {
            'Content-Disposition': `filename=${encodeURI(item.file.name)}`
          },
          metadata: {
            size: item.file.size,
            lastModified: item.file.lastModified
          }
        };
        this.uploadService.control({
          action: 'upload',
          itemOptions: cfg,
          uploadId: item.uploadId
        });

from ngx-uploadx.

wil92 avatar wil92 commented on July 2, 2024

I tried to reproduce the bug but i couldn't. This is a picture of one of the times I tried.
image

Maybe is your browser, what you are using? (I'm using chrome)

from ngx-uploadx.

kukhariev avatar kukhariev commented on July 2, 2024

Chome.
http://localhost:4200/service-way, http://localhost:4200/service-code-way
master branch, with concurrency fix 0f41f5e (#11)

from ngx-uploadx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.