removeAfterUpload : Only if success? #331

Open
opened 2016-08-04 13:09:41 +00:00 by nlapointe · 1 comment
nlapointe commented 2016-08-04 13:09:41 +00:00 (Migrated from github.com)

Hi,

First of all, congrats for this awesome component!

Is it possible to set removeAfterUpload to true, only on success upload ?
Because on error, files are removed from queue, and user does'nt see the error status.

Many thanks,

Hi, First of all, congrats for this awesome component! Is it possible to set removeAfterUpload to true, only on success upload ? Because on error, files are removed from queue, and user does'nt see the error status. Many thanks,
Ckln commented 2016-09-19 02:35:10 +00:00 (Migrated from github.com)

you can easily do it yourself this way
just add the following code to your component :

        this.uploader.onSuccessItem = (fileItem, rep, status, header) => {
            fileItem.remove();
        }

assuming you named your FileUploader uploader this code will do the trick, and therfore you should not use the «removeAfterUpload» option when building your FileUploader.

you can easily do it yourself this way just add the following code to your component : ``` this.uploader.onSuccessItem = (fileItem, rep, status, header) => { fileItem.remove(); } ``` assuming you named your FileUploader uploader this code will do the trick, and therfore you should not use the «removeAfterUpload» option when building your FileUploader.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#331