- Print
- DarkLight
b2_copy_part
- Print
- DarkLight
Copies part of a file
Copies from an existing B2 file, storing it as a part of a large file which has already been started with b2_start_large_file.
When calling b2_copy_part, by default the entire source file will be copied to the destination. If you wish, you may supply a range
param to only copy a portion of the source file over.
PLEASE NOTE:
This API endpoint can be called using a GET
request by converting the parameters in the request body to query parameters.
An account authorization token, obtained from b2_authorize_account.
The token must have the writeFiles
capability and the readFiles
capability if the bucket is private.
The ID of the source file being copied.
The ID of the large file the part will belong to, as returned by b2_start_large_file.
A number from 1 to 10000. The parts uploaded for one file must have contiguous numbers, starting with 1.
The range of bytes to copy. If not provided, the whole source file will be copied.
If present, specifies the parameters for Backblaze B2 to use for accessing the source file data using Server-Side Encryption. This parameter must be provided only if the source file has been encrypted using Server-Side Encryption with Customer-Managed Keys (SSE-C), and the provided encryption key must match the one with which the source file was encrypted. See Server-Side Encryption for details.
If present, specifies the parameters for Backblaze B2 to use for encrypting the copied data before storing the destination file using Server-Side Encryption. This parameter must be provided only if the large file was started with Server-Side Encryption with Customer-Managed Keys (SSE-C), and the provided encryption key must match the one with which the large file was started. See Server-Side Encryption for details.
The request succeeded.
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 file as a 40-digit hex string. Large files do not have SHA1 checksums, and the value is "none". The value is null when the action is "hide" or "folder".
The MD5 of the bytes stored in the part. Not all parts have an MD5 checksum, so this field is optional, and set to null for parts that do not have one.
When the part is encrypted with Server-Side Encryption, the mode ("SSE-B2" or "SSE-C") and algorithm used to encrypt the data.
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).
status | code | description |
---|---|---|
400 | bad_bucket_id | The requested bucket ID does not match an existing bucket. |
400 | bad_request | The request had the wrong fields or illegal values. The message returned with the error will describe the problem. |
400 | source_too_large | The source file being copied is too large. |
The numeric HTTP status code. Always matches the status in the HTTP response.
A single-identifier code that identifies the error.
A human-readable message, in English, saying what went wrong.
status | code | description |
---|---|---|
401 | bad_auth_token | The auth token used is not valid. Call b2_authorize_account again to either get a new one, or an error message describing the problem. |
401 | expired_auth_token | The auth token used has expired. Call b2_authorize_account again to get a new one. |
401 | unauthorized | The auth token used is valid, but does not authorize this call with these parameters. The capabilities of an auth token are determined by the application key used with b2_authorize_account. |
status | code | description |
---|---|---|
403 | access_denied | The provided customer-managed encryption key is wrong. |
403 | transaction_cap_exceeded | Transaction cap exceeded. To increase your cap, sign in to your B2 Cloud Storage account online. Then select the Caps & Alerts link in the B2 Cloud Storage section of the sidebar. |
status | code | description |
---|---|---|
404 | not_found | File is not in B2 Cloud Storage. |
status | code | description |
---|---|---|
405 | method_not_allowed | method not allowed: <HTTP METHOD> |
status | code | description |
---|---|---|
408 | request_timeout | The service timed out reading the uploaded file |
status | code | description |
---|---|---|
416 | range_not_satisfiable | The Range header in the request is valid but cannot be satisfied for the file. |