Upload file content separately


File content can be uploaded separately using PUT /v2/files/{file-id}/content API. You may choose this mode when the file is small enough to upload in one single HTTP session, and re-upload again if the network connection fails.

Endpoint URL: {network.internalDNSName or network.proxyURL} received in DeviceInformation

Request Syntax

PUT /v2/files/:id/content


Request Headers

ParameterDescriptionRequired
AuthorizationAn access token with nas_read_write scope as well as the File Permission with value WriteFile or FileOwner for the file or a parent.

Value of type: string
true
If-MatchA previous response ETag or *. Return the object only if its entity tag (ETag) is the same as the one specified.

Value of type: string
false
If-None-MatchA previous response ETag or *. Return the object only if its entity tag (ETag) is different from the one specified.

Value of type: string
false


Request Path Parameters

ParameterDescriptionRequired
idThe file ID of the file where content will be uploaded.

Value of type: string
true


204 Response

The normal case will be 204.

Response Headers

ParameterDescriptionRequired
ETagThe ETag for the resumable file metadata and content.

Value of type: string
false


Example

Sample request to upload content in an already created file.

Request

PUT /sdk/v2/files/{file-id}/content HTTP/1.1Host: Endpoint-URLAuthorization: Bearer 9e9d3d16-f9b1-43dc-8599-d1db6fcedfa9Content-Length: 20Content-Type: application/x-www-form-urlencoded

Response

HTTP/1.1 204 No ContentEtag: "BA"Vary: OriginDate: Mon, 29 Aug 2016 21:59:31 GMT