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

Upload on "FilesAdded" event fires twice #1462

Open
avramovic opened this issue Mar 20, 2017 · 8 comments
Open

Upload on "FilesAdded" event fires twice #1462

avramovic opened this issue Mar 20, 2017 · 8 comments
Milestone

Comments

@avramovic
Copy link

avramovic commented Mar 20, 2017

The idea is to start upload the moment files are dropped on the upload zone. But, whenever I drop a file on the #plupload div, two requests are fired to /upload. I have tried to use a flag uploadStarted thinking my code is being executed twice, but no. The alert() was added to confirm code is run only once, which is the case, but I'm still getting two requests to /upload and the files are being uploaded twice. Using v3.1.0

Here's the code I'm using:

var uploadStarted = false;

var uploader = new plupload.Uploader({
    browse_button: 'plupload',
    url: '/upload',
    filters: {
        mime_types : [
            { title : "Photos", extensions : "jpg,png,gif" }
        ],
        max_file_size: '40mb',
        prevent_duplicates: true
    }
});

uploader.init();

uploader.bind('FilesAdded', function(up, files) {

    if (!uploadStarted) {
        uploadStarted = true;
        uploader.start();
        alert('upload started');
    }
});
@atgrrr
Copy link

atgrrr commented Mar 21, 2017

Same problem here, i don't know how to solve it.

@avramovic
Copy link
Author

avramovic commented Mar 21, 2017

This happens in Chrome on MacOS Sierra. In Safari, when I drop two files, first one gets uploaded twice and second once. When I drop three files, two files get uploaded twice and third once 😕

@avramovic
Copy link
Author

Just to let you know, it works fine with v.2.3.1! Didn't know v.2.3.1 was the latest stable, I have used bower to install plupload and it automatically pulled v.3.1.0

@jayarjo
Copy link
Contributor

jayarjo commented Apr 1, 2017

v.3.1.0 is marked as pre-release (not ready for production). But it is an obvious bug.

@vlamirc
Copy link

vlamirc commented Apr 19, 2017

Same problem here. I will wait for the final v.3.1.0.

@silverpresident
Copy link

Same problem. 3.0-beta1 works fine but 3.0.1 causes a double upload request for each file.
It happens even when chucked uploading is disabled.

@burzum
Copy link

burzum commented Jun 12, 2017

Same issue here using 3.1.0, going back to another version.

@jayarjo jayarjo added this to the 3.1.1 milestone Aug 18, 2017
@Bird87ZA
Copy link

Bird87ZA commented Oct 28, 2017

Any idea on when this will be fixed? I have the same issue.

EDIT to add: 2.3.4 works fine here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants