filepond: Question: How to trigger revert
Thank you for this great plugin. I’m aware that by providing a {server: { revert:(...) => { object to setOptions will allow you to define custom operations processing uploaded files. But lets say I want to add some extra buttons to the uploader for several tasks, besides obviously creating my own onClick handlers, how can I, given a upload id already, inform filepond to revert an upload?
I know there’s a cancel button built in but my needs are more specific.
I’m using filepond with Vue as a single page component.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (5 by maintainers)
The
reverthandler is triggered by theremoveFilecall, so maybe you can use that?Is it possible to remove specify file by passing the id, it always remove the first file?
Can we do some thing like
this.$refs.filePond.removeFile({ revert: true, id: serverId });? (passing the actualid id in DB)@sbusch this functionality has been reset in
4.13.7as it caused backwards incompatibility issues, you can still trigger revert by adding{ revert: true }as a parameter toremoveFile()orremoveFiles()@sbusch should be fixed in release 4.19
@rikschennink Thanks for the heads-up, didn’t expect that kind of service! I’ll update & test it
Works for me,
removeFile()andremoveFiles()trigger theDELETErequest 😃Thank you very much!
@sbusch You’re right, it doesn’t call the
revert, see test case: https://codesandbox.io/s/vanilla-filepond-revert-remove-o2yqo?file=/src/index.jsWill see if I can pick this up later this week.