On Remove, how removing the actual files? #343
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi Guys,
I am using the ng2-file-upload, and when I click on remove,
files will still be there.
How can I actual delete them please?
Kind Regards
I had the same problem. I want to clear the file in input tag after uploading.
ng2-file-upload does not support that thing yet. So you can use @ViewChild of angular 2.
for example:
html file
component class
Is there any other method to achieve this ? Also if i select a file and remove it before uploading from queue and try to add it again, i am not able to add it in queue.
This works, but I don't understand it. When does clearSelectedPicture get called?
@hetzbr
You can call it anywhere you want. What you can do is create a new method on the component that handles removing, like this:
And then use it like this:
this.selectedPicture.deleteAll();
Worked for me
this.uploader.queue=[];
worked for me.
above things is not working for me. I'm using angular 6.
Thanks All.
deleteFile(index: number) {
this.attachments.splice(index, 1);
}