Source Code Bundles
Uploads one part of a large file to B2, using an file ID obtained
Once all of the parts are uploaded, use
If you upload the same part number for the same file more than once, both uploads will succeed, and the second upload will overwrite the first.
The upload request is a POST. The file name and other parameters are in the request headers, and the file to be uploaded is the request body.
Request HTTP Headers
An upload authorization token, from
A number from 1 to 10000. The parts uploaded for one file must have contiguous numbers, starting with 1.
The number of bytes in the file being uploaded. Note that this
header is required; you cannot leave it out and just use chunked
The SHA1 checksum of the this part of the file. B2 will check this
when the part is uploaded, to make sure that the data arrived
Request HTTP Message Body Parameters
There are no JSON parameters allowed. The file to be uploaded is the message body and is not encoded in any way. It is not URL encoded. It is not MIME encoded.
Response HTTP Status 200
File part successfully uploaded. The JSON response will contain:
The file ID for uploading this file.
Which part this is.
The number of bytes stored in the part.
The SHA1 of the bytes stored in the part.
This is a UTC time when this part was uploaded. It is a base 10 number of milliseconds since midnight, January 1, 1970 UTC. This fits in a 64 bit integer such as the type "long" in the programming language Java. It is intended to be compatible with Java's time long. For example, it can be passed directly into the java call Date.setTime(long time).
File not uploaded.
If possible the server will return a JSON error structure. Errors include:
v1: Add uploadTimestamp field (August 30, 2018)
The response now includes the same
v1: Application keys (July 26, 2018)
Incompatible change: After calling b2_authorize_account with an application key that does not have the right permissions, this call will return a 401 Unauthorized.
v1: Original release (September 22, 2015)