Hi all I get an image that comes from the server side and shows it in the website I want to download it when download button is pressed How do I achieve this?
I have the html as follows
<div class="row SectionRow" style="margin: 50px 0px !important;">
<div class="col-md-6 col-sm-6 col-xs-6" style="text-align: center; margin-bottom: 20px">
<img #imgRef2 class="ProfileImage">
<br>
<button type="button" (click)="DownloadProfilePic()" class="btn btn-default SigButton">Download</button>
</div>
<div class="col-md-6 col-sm-6 col-xs-6" style="text-align: center; margin-bottom: 20px; padding-top: 50px;">
<img #imgRef class="SignatureImage">
<br>
<button type="button" class="btn btn-default SigButton">Download</button>
</div>
</div>
angular typescript
@ViewChild('imgRef') Signature: ElementRef;
@ViewChild('imgRef2') ProfilePic: ElementRef;
OnInit()
{
this.Signature.nativeElement.src = this.ImageAppDetails.AA_SIGNATURE;
this.ProfilePic.nativeElement.src = this.ImageAppDetails.AA_PHOTO;
}
The url will be for profile pic as 'http://192.0.0.100/image.jpg'
how do I acheive this when I click the download button. Help would be appreciated.