tp5文件上传展示

 //接收文件
$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>
上一篇:Unable to find the ncurses libraries or the required header files解决


下一篇:EasyARM-iMX283A的make menuconfig出现错误:Install ncurses(ncurses-devel) and try again。