0
I have the following input file that uploads an image and turns to Base64:
<div class="image-upload">
<img class="fotoAnimal" [src]="imageSrc" style="max-width:300px;max-height:300px"/>
<label for="upload" class="file-upload__label">Procurar foto</label>
<input id="upload" class="file-upload__input" name="imageUrl" type="file" accept="image/*" (change)="handleInputChange($event)" />
</div>
My function that uploads:
handleInputChange(e) {
var file = e.dataTransfer ? e.dataTransfer.files[0] : e.target.files[0];
var pattern = /image-*/;
var reader = new FileReader();
if (!file.type.match(pattern)) {
alert('Formato inválido, permitido apenas jpeg e');
return;
}
reader.onload = this._handleReaderLoaded.bind(this);
reader.readAsDataURL(file);
}
_handleReaderLoaded(e) {
let reader = e.target;
this.imageSrc = reader.result;
console.log(this.imageSrc)
}
After an image is selected, the field continues "Find photo", I would like to switch to "Find another photo". How can I do this at the angle?
Young I think you can solve this only with CSS...
– hugocsl