# Upload Large File
# API Description
This API is used to upload file to OSS ,50M is max size.Total size is 500G. Below file type is allowed : .JPG.JPEG.GIF.TIF.BMP.PNG.AI.TGA.MP4.MP3.WAV.DOC.WMA.WPEG.RAR.ZIP.DAT.DOCX.AVI.ISO.PDF.XLS.XLSX.CSV.PPTX.TXT.GZ.TAR.MPG.RTF.M4A.PPT.MOV
# Environment
# Test
https://oversea.saicmaxus.com/australia/test/fir/large_file/upload (opens new window)
# Prod
https://oversea.saicmaxus.com/australia/fir/large_file/upload (opens new window)
# Method
POST
# Request
# Authorization
Set 'maxus_jwt' in header,see in Get Maxus JWT Token
# Payload
| Parameter | Type | Required | Description | 中文描述 |
|---|---|---|---|---|
| file | File | Yes | upload file limit in 50M | 文件限制在50MB内 |
| uploadId | String | Yes | Upload sharding and merge sharding parameters. Get from API Large File Initialization | 文件上传id,见接口Large File Initialization |
| partNum | int | Yes | Number of shards.When the source file is larger than 5MB, except for the last shard, it is recommended to split each shard by at least 5MB | 分片数量,当源文件大于5MB时,除最后一个分片外,建议将每个分片分割至少5MB |
# Example
curl --request POST \
--url https://oversea.saicmaxus.com/australia/test/fir/large_file/upload \
--header 'content-type: multipart/form-data' \
--header 'maxus_jwt: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhc2NDb2RlIjoiNDE5ODEzMCIsImFzY0lkIjo0MTk4MTMwLCJhc2NOYW1lIjoiQVRFQ08iLCJleHBpcmVUaW1lU3RhbXAiOiIxNzEwMTM4NTI0NDMyIiwic2FwQWNjb3VudCI6IjQxOTgxMzAiLCJzZXJ2aWNlQ29kZSI6IkF0ZWNvIiwiaWF0IjoxNzEwMTM4MzQ0LCJleHAiOjE3MTAxMzk3ODR9.0O8pyaw0jkmooOHtFf54wYQsXgfrI4GQYOgUZ48cI4Q' \
--form 'uploadId=2~e0oRomCkLDF6WwQnzloDxO9Ul04MTGL' \
--form partNum=3 \
--form 'file=@C:\Users\ding\Pictures\Saved Pictures\3c308ac6a1f14761a05928154f907afb.mp4'
# Response
# Payload
| Parameter | Type | Description |
|---|---|---|
| status | int | 1: Success, 0: Failure |
| errMsg | String | Error message |
| data | object | |
| data.partNumber | int | Number of shards |
| data.eTag | String | Shard file |
# Response Code (errCode)
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Unknown Error |
| 503 | Dependency System Unavailable |
# Example
# OK
{
"status": 1,
"errMsg": "SUCCESS",
"errCode": "200",
"data": {
"partNumber": 3,
"etag": "32941d339a14d6db1887e6ed84eecc94"
}
}
# NOT FOUND
{
"status": 0,
"errMsg": "NOT FOUND",
"errCode": "404",
"data": null
}
# INTERNAL ERROR
{
"status": 0,
"errMsg": "DEPENDENCY SYSTEM UNAVAILABLE",
"errCode": "503",
"data": null
}
{
"status": 0,
"errMsg": "UNKNOWN ERROR",
"errCode": "500",
"data": null
}
# GATEWAY ERROR
http status code: 500
# Unit Test
TODO