💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
## 上传文件 The file uploads in`$_FILES`are available from the Request object’s`getUploadedFiles()`method. This returns an array keyed by the name of the`input`element. > `$_FILES`中的文件上传可以从请求对象的`getUploadedFiles()`方法获得。这将返回一个以`input`元素的名称作为键值的数组。 ~~~php $files = $request->getUploadedFiles(); ~~~ Figure 11: Get uploaded files Each object in the`$files`array is a instance of`Psr\Http\Message\UploadedFileInterface`and supports the following methods: > $files数组中的每个对象都是`Psr\Http\Message\UploadedFileInterface`的实例,并且支持以下方法: * getStream() * moveTo($targetPath) * getSize() * getError() * getClientFilename() * getClientMediaType() See the[# 使用POST表单上传文件]([https://ihavenolimitations.xyz/dehuadong/slim4/1332006](https://ihavenolimitations.xyz/dehuadong/slim4/1332006))on how to upload files using a POST form.