# 上传文件plg_cmd_upload_file
### 请求参数
| type | 1.图片 / 2.视频 / 3.音频 / 4.文档 |
| --- | --- |
| tableType | 来源类型 |
| tableName | 来源表名 |
| tableField | 来源字段名,默认为 id |
| tableId | 来源表 UUID,存储时转换成真实 ID |
| tableKey | 来源表键名 |
| mode | 1.上传文件 2.上传文件信息 |
| file | 1.上传文件(一定要以request()->file('file) 方式获取文件信息后传值) |
| fileInfo | 2.上传文件信息数组,以字符串传参压缩后的 Array 数组信息 |
| platform | 平台编号 |
```
$cmd = FresnsPluginConfig::PLG_CMD_UPLOAD_FILE;
$input['type'] = $type;
$input['tableType'] = $tableType;
$input['tableName'] = $tableName;
$input['tableField'] = $tableField;
$input['tableId'] = $tableId;
$input['tableKey'] = $tableKey;
$input['mode'] = $mode;
$input['file'] = $file;
$input['fileInfo'] = $fileInfo;
$input['platform'] = $platform;
$resp = PluginRpcHelper::call(FresnsPlugin::class, $cmd, $input);
if(PluginRpcHelper::isErrorPluginResp($resp)){
$this->errorCheckInfo($resp);
}
```