Fail to re-add same file after remove it from queue #1144

Closed
opened 2020-03-20 03:18:55 +00:00 by nankingcigar · 1 comment
nankingcigar commented 2020-03-20 03:18:55 +00:00 (Migrated from github.com)

Fail to re-add same file after remove it from queue
Solution:
Please support clear input file value after remove file from queue.

Fail to re-add same file after remove it from queue Solution: Please support clear input file value after remove file from queue.
Yuricoden commented 2020-03-22 20:21:57 +00:00 (Migrated from github.com)

@nankingcigar Just set empty value after request

@ViewChild('fileInput', null) fileInput: ElementRef;

<input id="file_loader" type="file" ng2FileSelect [uploader]="uploader" (change)="fileDropped($event.target.files);" #fileInput style="display: none;" />

uploadFile = () => {
this.fileService
.createFileDocument()
.pipe(retry(100))
.subscribe(
data => {
this.fileInput.nativeElement.value = '';
},
error => {
this.fileInput.nativeElement.value = '';
}
);
}

@nankingcigar Just set empty value after request @ViewChild('fileInput', null) fileInput: ElementRef; <input id="file_loader" type="file" ng2FileSelect [uploader]="uploader" (change)="fileDropped($event.target.files);" #fileInput style="display: none;" /> uploadFile = () => { this.fileService .createFileDocument() .pipe(retry(100)) .subscribe( data => `{` this.fileInput.nativeElement.value = ''; }, error => { this.fileInput.nativeElement.value = ''; } ); }
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#1144