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] onprocessfiles does not triggered if I already had files loaded #992

Open
2 tasks done
nike1v opened this issue Aug 7, 2024 · 4 comments
Open
2 tasks done
Labels

Comments

@nike1v
Copy link

nike1v commented Aug 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Have you updated FilePond and its plugins?

  • I have updated FilePond and its plugins

Describe the bug

I'm trying to call a function when all files are uploaded to the server, the onprocessfiles looks what I need and it works as I want when there are no items loaded from files property. But if I'm instead editing (have files property populated with filepaths and local type), then when I'm adding new items, the onprocessfiles are not triggered.

Reproduction

Use jQuery version of the library and try to call onprocessfiles when there are already populated files property.

Environment

- Device: PC
- OS: Windows 11
- Browser: Chromium
@nike1v nike1v added the bug label Aug 7, 2024
@rikschennink
Copy link
Collaborator

Thanks for reporting, sounds like a bug indeed, will look into it as soon as possible.

@rikschennink
Copy link
Collaborator

In the mean time, could you subscribe to updatefiles and then check if all files are processed?

You can check the status property of the file, see: https://pqina.nl/filepond/docs/api/exports/#filestatus

@OscarGodson
Copy link

I'm running into this issue but my issue is that status says 9 which is processing. I'm using React. Im not sure how after to know when all files are done processing. I can check individual files but then I need to track every state for every file when really I just want the files from setFiles. Since setFiles is setting the file object itself I lose the ability to check the status.

How can I be notified when all files are processed and have a reference to the FilePondFile rather than raw files so I can check the status?

@rikschennink
Copy link
Collaborator

@OscarGodson I think you can check the files in onupdatefiles before calling setState ?

onupdatefiles={fileItems => {

            // check fileItems status

            this.setState({
              files: fileItems.map(fileItem => fileItem.file)
            });
}}

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

No branches or pull requests

3 participants