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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate file issue 馃檮 #2265

Open
dhruvil2487 opened this issue Oct 18, 2023 · 2 comments
Open

Duplicate file issue 馃檮 #2265

dhruvil2487 opened this issue Oct 18, 2023 · 2 comments

Comments

@dhruvil2487
Copy link

Describe the bug
If the user drags the file, then Dropzone again uploads a duplicate file.

To Reproduce
Steps to reproduce the behavior:

  1. upload the file
  2. Drag the file a little bit
  3. you can see a duplicate file is created
  4. See error

Expected behavior
Do not create duplicate files if the user drags the file.

Screenshots & video recording
chrome-capture-2023-9-18
image

Browser / OS:

  • OS & Device: [windows 10]
  • Browser [Chrome]
  • Version [118.0.5993.89]

Additional context
Duplicate files created with different names

@vdejager
Copy link

vdejager commented Nov 16, 2023

I've tried the preventDuplicates: true, option, but also get the same issue in 6 beta

@vdejager
Copy link

vdejager commented Nov 16, 2023

Anyway,

this piece of code works (https://stackoverflow.com/questions/26296232/dropzone-prevent-uploading-of-duplicate-files):

if (this.files.length) {
        var _i, _len;
        for (_i = 0, _len = this.files.length; _i < _len - 1; _i++) // -1 to exclude current file
        {
            if(this.files[_i].name === file.name && this.files[_i].size === file.size && this.files[_i].lastModified.toString() === file.lastModified.toString())
            {
                this.removeFile(file);
            }
        }
    }

could this just be a setting, like preventDuplicates: true (which does not seem to exist in the 6beta codebase).
A requirement should be that the associated events are not fired for the duplicate file

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

2 participants