I'd like to replace the "Choose File" text and ugly styling of the <input type="file" />
button with some other text such as "Upload" and nice styling, perhaps using a mat-button
. What is the cleanest way to achieve this without installing any extra file-upload packages?
Use below template:
.html:
<button type="button" (click)="fileInput.click()">
<span>Upload</span>
<input #fileInput type="file" (change)="onFileInput($event)" style="display:none;" />
</button>
The on-click function will prompt the user to select a file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With