Load a file to a directory
The file is uploaded to the specified directory of the Files workspace. You must have enough disk space for the file to be saved. If there is a file with the same name in the directory, a postfix with a number will be added to the name, for example, (1).
To upload a file, you need to generate a UUID and pass it in the
hash request parameter. This will be the file body ID.
You can upload a file in full or in parts. To upload the whole file, pass the
Content-Range header with the value
bytes 0-[size]/[size] (for example,
To upload a file in parts, you need to divide it. All parts must be of equal size, except for the last one. The size of the main parts must be between 5 MB (5 242 880 B) and 5 GB (5 368 709 120 B). The remaining part can be of any size.
To inform the server which of the parts is being uploaded, you need to pass the
Content-Range header. It is set by the following template:
bytes [range-start]-[range-end]/[size]. For example, to upload a 7 MB file, you’d need tp pass the following headers:
bytes 0-5242880/7340032 for the first 5 MB part of the file and
bytes 5242880-7340032/7340032 for the remaining part.
File body ID
This request requires the use of one of following authorisation methods:
The following HTTP status codes may be returned:
The file is fully uploaded
Part of the file is successfully uploaded
The error is shown as a message that describes the problem. The error message may contain the following codes:
Not enough disk space
No permissions to create a file
Server response after the file is uploaded to the directory
|Server response after the file is uploaded to the directory (Load a file to a directory)|