如何在Laravel中为二维码图像创建下载链接? [英] How to create download link for qr code image in Laravel?

查看:48
本文介绍了如何在Laravel中为二维码图像创建下载链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Laravel 5.2和 我可以保存该图像,右键单击图像>保存图像.但是我想建立一个链接,以便我可以通过单击下载链接"按钮来下载此图像.等同于:

I am using Laravel 5.2 and I can save this image, right click on image>save image. But i want to make a link so that i can download this image with clicking download link button. Same as: this

用于创建二维码的mycode:

mycode for creating qr code:

<div class="text-center">
    <img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->size(100)->generate('helloworld')) !!} ">
    <p>Scan me to return to the original page.</p>
</div>

QR码输出:

有没有人可以帮助我解决这个问题?预先感谢.

Is there anyone who can help me regarding this issue? Thanks in advance.

推荐答案

我认为您可能会在生成QRCode作为图像

I think you might looking for download image of QR Code after generating a QRCode as image download

<a href="/images/myw3schoolsimage.jpg" download>

或者您可以固定文件名

<a href="/images/myw3schoolsimage.jpg" download="filename">

这篇关于如何在Laravel中为二维码图像创建下载链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆