Skip to main content

Upload chunked file

A request to upload new file with chunked processing.

note

[Since 2019.02]

POST /api/v1/files/uploadChunked HTTP/1.1

Generates Notification add file/folder OR Notification file import.

  1. Request parameters
ParameterDescription
metadataMetadata for uploaded file, e.g. parentId to specify target folder, filename and mediaType are required.
convertBoolean flag to force convertion of file to internal format.
conflictStrategyConflict resolution strategy (keep_both / overwrite / versioned)
synchronousForce upload operation with convert=true to be synchronous.
timezoneOffsetMinsTimezone to be used during the conversion process [Since 2017.03]
  1. Response structure

See Get file info.

  1. Example request
note

File in curl request should be passed as '-T somefilename.txt'

curl 'http://localhost:8080/api/v1/files/uploadChunked?convert=false&conflictStrategy=keep_both&synchronous=true&metadata=%7B%22filename%22:%22testfile.txt%22,%22mediaType%22:%22text/plain%22,%22parentId%22:%2263139ee4-766c-4a2b-b6e1-df54e1bf7ae0%22%7D' -i -X POST \
-H 'X-co-auth-token: f571e4bf982a8c49c492d636e793f07c' \
-d 'some example content'
  1. Example response
HTTP/1.1 200 OK
X-co-request-id: 734546306b4e3147304f6e755a6f4432
X-co-deprecated: true
Content-Type: application/vnd.ncloudtech.cloudoffice.file+json;v=1;charset=UTF-8
Content-Length: 2395
{
"file": {
"id": "189352335",
"createdDate": "2022-04-06T15:56:57.000Z",
"creator": "testsrvdocs@tacos.devoffice.ru",
"creatorFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"creatorFirstName": "r",
"creatorLastName": "t",
"creatorMiddleName": "f",
"fileSize": "20",
"filename": "testfile.txt",
"headRevisionId": "189352336",
"lastModifyingUserId": "testsrvdocs@tacos.devoffice.ru",
"lastModifyingUserFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"lastModifyingUserFirstName": "r",
"lastModifyingUserLastName": "t",
"lastModifyingUserMiddleName": "f",
"mediaType": "text/plain",
"modifiedByMeDate": "2022-04-06T15:56:57.000Z",
"modifiedDate": "2022-04-06T15:56:57.000Z",
"ownerFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"ownerId": "testsrvdocs@tacos.devoffice.ru",
"parentId": "189352270",
"properties": [
{
"id": "sharedParent",
"key": "sharedParent",
"value": "true"
}
],
"totalSize": "20",
"checksum": "e0e102b9ff40785fac8902d8bcbf2279",
"tree": "/docs-test-uploadChunkedFileExample()-84hONI9iKV/testfile.txt",
"ownerFirstName": "r",
"ownerLastName": "t",
"ownerMiddleName": "f",
"isVersion": false,
"originalFileIdOpt": null,
"creatorIsDeleted": false,
"editorIsDeleted": false,
"ownerIsDeleted": false,
"ownerAvatar": "",
"creatorAvatar": "",
"editorAvatar": ""
},
"links": [
{
"rel": "self",
"href": "http://localhost:8080/api/v1/files/189352335"
},
{
"rel": "download",
"href": "http://localhost:8080/api/v1/files/189352335/content"
},
{
"rel": "import",
"href": "http://localhost:8080/api/v1/files/189352335/import"
},
{
"rel": "preview",
"href": "http://localhost:8080/api/v1/files/189352335/preview"
},
{
"rel": "link",
"href": "http://localhost:8080/link/189352335"
}
]
}