您的位置:首页技术文章
文章详情页

thinkphp中Controller里面使用Request::File(’image’);

【字号: 日期:2022-06-01 17:05:56浏览:83作者:猪猪

问题描述

View

thinkphp中Controller里面使用Request::File(’image’);

Controller

thinkphp中Controller里面使用Request::File(’image’);

Error

thinkphp中Controller里面使用Request::File(’image’);

错误:Request::File('image');的返回值是null。

如何获取上传的图片路径?

问题解答

回答1:

thinkphp中Controller里面使用Request::File(’image’);

$img='<img src='."你自己相应的路径";

$img.='>';

echo $img;

按照这个输出一下,看看你的图片能不能正常显示,这就能看看你路径对不对

回答2:

config/filesystem.php配置文件中配置上传根目录如果没有更改的话,默认存储runtime/storage/topic/,多应用的话应该为runtime/index/storage

相关文章: