Skip to content

Incorrectly applied maxFiles restriction with previously loaded files #44

@DmitryFX

Description

@DmitryFX

Describe the bug
Incorrectly applied maxFiles restriction with previously loaded files. Currently takes into account only new loaded files.

To Reproduce
Steps to reproduce the behavior:

  1. Say maxFiles = 2
  2. Loaded N files from the server, showing with displayExistingFile()
  3. Adding new files...
  4. "maxfilesreached" fired only when we add 2 new files.
  5. Now we have N + 2 files.
  6. Save form, reload page, add 2 more files, etc.

Expected behavior
The restriction must take into account previously loaded files, not allowing to exceed the limit.

There is a controversial issue, when we have more files on the server than the maxFiles (e.g. we have lowered the limit after the previous uploads). We can show them as valid files or just apply a visual '.dz-error' effect to those, which exceed the limit, and obviously not allowing adding new files.

Will dig into the code a bit later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions