I am using QR code API from this website. It generates QR code image from the URL input we give to it. For example, I am showing the QRCode of data 'abcd' on my website by adding an <img>
tag of src=https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=abcd
. This shows the QR on screen, but I also want to give a download link to that image. Suppose if a user clicks on that image, it should get downloaded. How to do that? I am confused because the image is getting generated dynamically and I dont have a name or specific url to it.
Asked
Active
Viewed 111 times
0

tigerden
- 728
- 2
- 11
- 28
-
Perhaps including an `` tag with the href of src of the img tag? – Atutouato Mar 08 '14 at 18:14
-
@Atutouato tried but that didn't work. It loaded the image in browser but didn't download it – tigerden Mar 08 '14 at 18:28
-
possible duplicate of [How can I make a url a download link in html?](http://stackoverflow.com/questions/19174327/how-can-i-make-a-url-a-download-link-in-html) – unor Mar 09 '14 at 00:07
-
@unor, this is not a duplicate. Tigerden does not have any control over the Content-Type attribute of the headers of the qrserver site, so they can't use that solution. – Atutouato Mar 09 '14 at 18:27
-
@Atutouato: Well, the question is a duplicate (no matter which answer got accepted), isn’t it? Btw, other answers suggest alternatives that don’t need changing HTTP headers. – unor Mar 09 '14 at 18:48
-
@unor, OK, never mind. – Atutouato Mar 10 '14 at 02:29