How to get response on successful upload of multiple items #743

Open
opened 2017-04-13 09:39:59 +00:00 by shakthi23 · 4 comments
shakthi23 commented 2017-04-13 09:39:59 +00:00 (Migrated from github.com)

##Hi All,
I am uploading multiple files, After uploading of multiple files, I want to get the response of all items, I need to do some process after getting the response after the successful upload.

I have used 'this.uploader.onCompleteAll', but it does not return anything as per code.

Could anyone let me know how i can do this, please.

##Hi All, I am uploading multiple files, After uploading of multiple files, I want to get the response of all items, I need to do some process after getting the response after the successful upload. I have used 'this.uploader.onCompleteAll', but it does not return anything as per code. Could anyone let me know how i can do this, please.
shakthi23 commented 2017-04-17 08:38:19 +00:00 (Migrated from github.com)

Could anyone please respond on this query, please?

Could anyone please respond on this query, please?
SanjuSudheerM commented 2017-04-26 13:56:29 +00:00 (Migrated from github.com)

I had the same issue and I resolved it like uploading one by one.
I have paste the code below

public uploadDocuments(){
for(let file of this.uploader.queue){
this.uploadFile(file);
}
}

public uploadFile(file) {
    file.upload();

    this.uploader.onCompleteItem = (item: any, response: any, status: any, headers:any)=>  {
        //things to do on completion
    };
}
I had the same issue and I resolved it like uploading one by one. I have paste the code below public uploadDocuments(){ for(let file of this.uploader.queue){ this.uploadFile(file); } } public uploadFile(file) { file.upload(); this.uploader.onCompleteItem = (item: any, response: any, status: any, headers:any)=> { //things to do on completion }; }
SuperMariosYoshi commented 2017-08-23 19:58:48 +00:00 (Migrated from github.com)

@SanjuSudheerM Can you show me html and ts example of that, i want to see how you implemented that ?

@SanjuSudheerM Can you show me html and ts example of that, i want to see how you implemented that ?
WPAS commented 2018-08-20 11:25:46 +00:00 (Migrated from github.com)

@shakthi23

'onCompleteAll' is a hook, not a function. You use it in a similar way as ngOnInit in Angular. Do like that:

this.uploader.onCompleteAll = () => {
  console.log('All done');
})
**@shakthi23** 'onCompleteAll' is a hook, not a function. You use it in a similar way as ngOnInit in Angular. Do like that: this.uploader.onCompleteAll = () => { console.log('All done'); })
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#743