I am trying to include dinamically created QR Code images in my website, using http://goqr.me/ API.
I'd like to create a button to download the image, using the download
attribute in an hyperlink, but instead of downloading the image it opens it in the browser.
My code is as follows:
<div class="card" style="width: 20rem;">
<img class="card-img-top mx-auto mt-4" style="width: 150px;" src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=https://example.com" alt="Card image cap">
<div class="card-body">
<h4 class="card-title">QR Code</h4>
<p class="card-text">Download your code by clicking on the button below</p>
<a download="qrcode.png" href="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=https://example.com" class="btn btn-info">Download QR Code</a>
</div>
</div>
What am i doing wrong?