html input with mat form module
<mat-form-field>
<ngx-mat-file-input accept="image/*" (change)="changeProfileImg($event)">
</ngx-mat-file-input>
</mat-form-field>
below is type script function for receiving images and converting into base64
changeProfileImg = (e: any) => {
const file = e.target.files[0]
let encoded;
this.getBase64(file)
.then((result) => {
encoded = result;
//this.AddModel.image.push(result)
console.log(result)
this.UserModel.profilePicture=result;
})
.catch(e => console.log(e))
}
and line works perfectly fine
<input type="file" class="input-upload" name="myfile" accept="image/*" (change)="changeProfileImg($event)" multiple/>