Chunked upload
POST /api/2.0/files/{folderid}/upload/create_session
Request
Creates a session to upload large files in multiple chunks to the folder with the ID specified in the request.
Note: Note: Each chunk can have different length but the length should be multiple of 512 and greater or equal to 10 mb. Last chunk can have any size. After the initial response to the request with the 200 OK status, you must get the location field value from the response. Send all your chunks to this location. Each chunk must be sent in the exact order the chunks appear in the file. After receiving each chunk, the server will respond with the current information about the upload session if no errors occurred. When the number of bytes uploaded is equal to the number of bytes you sent in the initial request, the server responds with the 201 Created status and sends you information about the uploaded file.
Authorization
An API key is a token that you provide when making API calls. Include the token in a cookie parameter called asc_auth_key
.
Example: asc_auth_key=864FE52C-1C1C-469F-9308-51DAFEFE7436
.
Headers
- Accept
enum of string
Can be one of:
application/json
,text/json
,text/plain
.- Content-Type
enum of string
Can be one of:
application/json
,application/*+json
,text/json
.
Path
- folderId
integer
int32required Folder ID
Body
Session parameters
- fileName
string
File name
- fileSize
integer
int64 File length in bytes
- relativePath
string
Relative path to the folder
- createOn
object
- utcTime
string
date-time UtcTime
- timeZoneOffset
string
date-span TimeZoneOffset
- encrypted
boolean
Specifies whether to encrypt a file or not
- createNewIfExist
boolean
Create new if exists
Examples
POST /api/2.0/files/%7Bfolderid%7D/upload/create_session HTTP/1.1
Accept: application/json
Content-Length: 235
Content-Type: application/json
Host: example.com
{
"fileName": "some text",
"fileSize": 1234,
"relativePath": "some text",
"createOn": {
"utcTime": "2008-04-10T06:30:00.0000000+04:00",
"timeZoneOffset": "00:00:00"
},
"encrypted": true,
"createNewIfExist": true
}
curl --request POST \
--url https://example.com/api/2.0/files/%7Bfolderid%7D/upload/create_session \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"fileName": "some text",
"fileSize": 1234,
"relativePath": "some text",
"createOn": {
"utcTime": "2008-04-10T06:30:00.0000000+04:00",
"timeZoneOffset": "00:00:00"
},
"encrypted": true,
"createNewIfExist": true
}'
Responses
200
Information about created session
401
Unauthorized
403
You don't have enough permission to create