Creates a session to upload large files in multiple chunks to the folder with the ID specified in the request.
Name | Description | Type | Example |
folderId
sent in body
|
Folder ID | number | 1234 |
FileName
sent in body
|
File name | string | some text |
FileSize
sent in body
|
File length in bytes | number | 1234 |
RelativePath
sent in body
|
Relative path to the folder | string | some text |
CreateOn
sent in body
|
Creation time | Date and Time | Roundtrip format: 2008-04-10T06-30-00.000Z |
Encrypted
sent in body
|
Specifies whether to encrypt a file or not | Bool value | true |
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.
POST api/2.0/files/{folderid}/upload/create_session Host: yourportal.onlyoffice.com Content-Type: application/json Accept: application/json { "folderId": 1234, "FileName": "some text", "FileSize": 1234, "RelativePath": "some text", "CreateOn": "2008-04-10T06-30-00.000Z", "Encrypted": true }
Information about created session which includes: