Upload File¶
Upload the file into the specified directory.
Request format¶
POST http://{apigw-address}/dfs-api/v1.0/upload/
Request parameters (URI)¶
Name |
Location (Path/Query) |
Required or not |
Data type |
Description |
---|---|---|---|---|
Content-Type |
Header |
True |
multipart/form-data |
Type of return content |
tenant |
Query |
True |
String |
Tenant name |
targetFileName |
Query |
Yes |
String |
Target file name |
targetPath |
Query |
True |
String |
Uploading path of target file |
loginTenant |
Query |
True |
String |
Currently logged-in tenant |
overWrite |
Query |
True |
Boolean |
Whether to overwrite the existing file or not. True indicates that the existing file will be overwritten. False indicates that if the target file already exists, the file will not be uploaded. |
Request parameters (Body)¶
Name |
Required or not |
Data type |
Description |
---|---|---|---|
file |
True |
Form-data |
File to be uploaded |
Response parameters¶
Name |
Data type |
Description |
---|---|---|
status |
Int |
Status code |
msg |
String |
Response message |
submsg |
String |
Response sub-message |
data |
Null |
Response data |
Sample¶
Request sample¶
POST http://{apigw-address}/dfs-api/v1.0/upload?targetPath=/path/&targetFileName=sample.txt&tenant=EDGE&loginTenant=EDGE&overWrite=False
body: {
"file":sample.txt
}
header:{
"Content-Type":"application/json"
}
Return sample¶
{
"status":0,
"msg":"Upload succeeded",
"submsg":"",
"data":null
}