文件直传接口
开发中
POST
/api/v1/system/common/upload-file
iThings-apisvr/系统管理/通用功能
请求参数
Header 参数
iThings-token
string
可选
默认值:
{{iThings-token}}
iThings-project-id
string
可选
默认值:
1786838173980422144
iThings-app-code
string
可选
默认值:
{{iThings-app-code}}
iThings-user-role
string
可选
默认值:
1
Accept-Language
string
可选
默认值:
en
iThings-tenant-code
string
可选
Body 参数multipart/form-data
file
file
上传的文件
scene
string
可选
示例值:
productImg
filePath
string
文件名
示例值:
123.bat
rename
string
可选
示例值:
false
business
string
可选
示例值:
productManage
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v1/system/common/upload-file' \
--header 'iThings-token: {{iThings-token}}' \
--header 'iThings-project-id: 1786838173980422144' \
--header 'iThings-app-code: {{iThings-app-code}}' \
--header 'iThings-user-role: 1' \
--header 'Accept-Language: en' \
--header 'iThings-tenant-code;' \
--form 'file=@""' \
--form 'scene="productImg"' \
--form 'filePath="123.bat"' \
--form 'rename="false"' \
--form 'business="productManage"'
返回响应
🟢200成功
application/json
Body
code
integer
必需
msg
string
必需
data
object
必需
filePath
string
文件路径(带文件名)
fileUri
string
文件url
示例
{
"code": 0,
"msg": "string",
"data": {
"filePath": "string",
"fileUri": "string"
}
}

扫码加入 iThings微信交流群

