Automatically remove file
Closed this issue · 3 comments
alenxmedia commented
Hello,
Is there a way to automatically remove successfully uploaded file?
ko commented
Is this behavior similar to what you're looking for?
If so, here's the diff of the few changes I made to the default example:
diff --git a/example/src/example_default.jsx b/example/src/example_default.jsx
index 412b457..89968ff 100644
--- a/example/src/example_default.jsx
+++ b/example/src/example_default.jsx
@@ -30,6 +30,8 @@ export default class Example extends React.Component {
this.removedfile = file => console.log('removing...', file);
+ this.complete = file => this.dropzone.removeFile(file);
+
this.dropzone = null;
}
@@ -43,6 +45,7 @@ export default class Example extends React.Component {
drop: this.callbackArray,
addedfile: this.callback,
success: this.success,
+ complete: this.complete,
removedfile: this.removedfile
}
alenxmedia commented
Yes. Thank you.
vmengh commented
Hi,
I need to implement this feature in the current application, but the above code snippet is not working for me. I defined the methods to remove file, complete file,
Post upload complete I am invoking removedFile method but it's removing the file from the Dropzone container cache.
Can you share/suggest what is missing or is there any extra required to make it work?
Also, the way you have defined the dropzone object, it doesn't work for me?
Thanks for help.
Regards
Vmengh