成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術(shù)文章
文章詳情頁

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

瀏覽:195日期:2022-06-01 17:05:56

問題描述

View

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

Controller

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

Error

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

錯(cuò)誤:Request::File('image');的返回值是null。

如何獲取上傳的圖片路徑?

問題解答

回答1:

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

$img='<img src='."你自己相應(yīng)的路徑";

$img.='>';

echo $img;

按照這個(gè)輸出一下,看看你的圖片能不能正常顯示,這就能看看你路徑對(duì)不對(duì)

回答2:

config/filesystem.php配置文件中配置上傳根目錄如果沒有更改的話,默認(rèn)存儲(chǔ)runtime/storage/topic/,多應(yīng)用的話應(yīng)該為runtime/index/storage

相關(guān)文章: