接上一篇,实现点击按钮下载
image.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>image</title>
</head>
<body>
<div>
<img src="/index/image/image" style="width: 100%" />
<a href="/index/image/image/download/1">//这里带一个download=1的值
<input type="button" value="下载">//多加一个下载按钮
</a>
</div>
</body>
</html>
Image.php
<?php
namespace app\index\controller;
use think\Request;
use think\Controller;
class Image extends Controller{
public $image