Monday 25 February 2019

In progress after selecting file

I have a button which when clicked will popup the file selector as below code:

<button mat-raised-button (click)="inputFile.click()">Choose a file</button>
<input #inputFile type="file" [style.display]="'none'" (change)="onChange($event)">
<label></label>

Then I set the file on onChange() so that the selected filename will display in the tag:

this.fileUpload = event.target.files[0];

However, when the file is large, it seems nothing is happening. The label is blank until the filename shows. Is there a way to put a progress/spinner while waiting for the file to be set?



from In progress after selecting file

No comments:

Post a Comment