💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
>[danger] 多文件上传 ``` <form action="{:url('index/upload')}" enctype="multipart/form-data" method="post"> <input type="file" name="image[]" /> <br> <input type="file" name="image[]" /> <br> <input type="submit" value="上传" /> </form> ``` ```php public function upload() { // 获取表单上传文件 // 数组对象 [对象1, 对象2, ...] $files = request()->file('image'); $savename = []; foreach($files as $file){ $savename[] = \think\facade\Filesystem::putFile('topic', $file); } /** array(3) { [0]=> string(52) "topic/20200131\fd9a546c5a7c2cf36d43fe76f520bf1c.jpeg" [1]=> string(51) "topic/20200131\00f446e1e4d501a7e1f3d6b2fef6ef34.jpg" } */ var_dump($savename); } ```