Attaching files to a transfer session
| Please note that the Cryptshare Server only allows this operation for a verified sender email address. |
After creating a transfer session, you are able to attach files to it. This happens in two steps.
Register a file to a transfer session
Before uploading a file, they have to be registered first and assigned to a transfer session by providing some information about them:
| Description | Property | Required |
|---|---|---|
The file name under which the file can be downloaded by the recipient (unique per transfer) |
fileName |
Yes |
The file size in bytes |
size |
Yes |
The checksum of the file to check after the transfer finalization if the files were uploaded correctly |
checksum |
No |
After registering the file, the fileId is returned in order to identify this file in other requests. Additionally, in the response’s location header the basic URL is returned where file-related actions can be executed (deletion with this URL or uploading the file contents by adding /content to the basic URL).
POST https://<your-url>/api/users/{email-address}/transfer-sessions/{tracking-id}/files
Upload the registered file
After registering a file, the location header of the registration can be used to send the file to.
PUT https://<your-url>/api/users/{email-address}/transfer-sessions/{tracking-id}/files/{file-id}/content
|
Content-Type header
In order to successfully upload a file, the Content-Type header has to be set to application/octet-stream. |