Aras Innovator Platform

Upload file chunk

The vault.UploadFile Method uploads the file chunk within a given transaction. The File ID is GUID generated on the client and passed to the vault server using the fileId query option. The upload must use Transfer-encoding: chunked and containing a Content-range header where the range is the range of bytes within the chunk of the file being transferred and the size is the file size. A Content-disposition header must be included containing the name of the file being uploaded.

POST http://vault/odata/vault.UploadFile?fileId=2778F0A17FDF4095A497A9A27B594376

VAULTID: {{vault_id}}

Content-Disposition:attachment; filename*=utf-8''file_0.txt

Content-Length:53

Content-Range:bytes 0-52/53

Content-Type:application/octet-stream

Aras-Content-Range-Checksum:2535782373

Aras-Content-Range-Checksum-Type:xxHashAsUInt32AsDecimalString

transactionid:{{transaction_id}}

… file chunk content

Response:

HTTP/1.1 200 OK

Note
You must add a VAULTID header to the vault.UploadFile request. To receive {{vault_id}} value, you must send the request as shown in the following example.

GET http://host/server/odata/User(‘{{current_user_id}}’)?$select=default_vault

Response:

{

"@odata.context": “http://host/server/odata/$metadata#User(default_vault)/$entity”,

"@odata.id": “User({{current_user_id}})”,

“default_vault@odata.associationLink": “User('{{current_user_id}}')/default_vault/$ref”,

“default_vault@odata.navigationLink": “User('{{current_user_id}}')/default_vault”,

“default_vault@aras.keyed_name": “Default”,

“default_vault@aras.id": "{{vault_id}}"

}