//接收文件
$file = request()->file('image');
//将文件移动到框架应用根目录/public/uploads/ 目录下
$info = $file->move(ROOT_PATH . 'public' . DS . 'uploads');
//更改文件名称入库
$data['image']=$info->getSaveName();
$res=Db::table("image")->insert($data);
if($res){
return $this->success("上传成功","show");
}else{
return $this->error("上传失败","file");
}
<table border="">
<tr>
<td>图片</td>
</tr>
{volist name="data" id="vo"}
<tr>
<td><img src="/uploads/{$vo.image}" width="100px" height="100px"></td>
</tr>
{/volist}
</table>