Closed ryanzzeng closed 3 years ago
https://pqina.nl/filepond/docs/api/instance/methods/#removing-files
// removes the first file item
pond.removeFile();
// removes the file item at index 1
pond.removeFile(1);
// removes the file item with the given id
pond.removeFile('imzsdvxar');
hi @rikschennink , it works with the new uploaded file, but not with the existing uploaded files. Even if i try to filter the exisiting file from getFiles() method, it still do not send the DELETE api request.
const allFiles = (this.$refs.filePond as VueFilePondComponent).getFiles();
cost fileIndex = allFiles.filter(/** get the index from all files**/);
(this.$refs.filePond as VueFilePondComponent).removeFile(fileIndex); // do not send any api request
I think this is a question for StackOverflow. It seems very dependent on your project setup. Please post it there and supply a codesandbox.io test case.
Describe the bug
When uploaded the same file twice(e.g. test.pdf), it will show 2 files at the frontend, But if i manually trigger the removeFile() function, only the first one will send an api request to the backend to delete the file, is it possible to specify the serverId and use removeFile(serverId) to delete the actual file ?
To Reproduce
Everytime i need to use getFiles() and use the index to locate the file , and
removeFile(allFiles[index)
, is it possible to use the serverId to trigger DELETE api?