pub async fn upload_file_part<C, E>(
auth: &mut UploadPartAuthorization<'_, '_, C, E>,
upload: &UploadFilePart<'_>,
data: &[u8],
) -> Result<FilePart, Error<E>>Expand description
Upload a part of a large file to B2.
Once all parts are uploaded, call finish_large_file_upload to merge the parts into a single file.
If you make two uploads with the same part number, the second upload to complete will overwrite the first.
The Authorization used to create the given UploadPartAuthorization must have Capability::WriteFiles.
A large file must have at least two parts, and all parts except the last must be at least 5 MB in size. See https://www.backblaze.com/b2/docs/uploading.html for further information on uploading files.
Some errors will requiring obtaining a new UploadPartAuthorization. See the B2 documentation for b2_upload_part or uploading files for information on these errors.
ยงParameters
auth: An upload authorization obtained via get_upload_part_authorization.part_num: The part number of this part; it must be between 1 and 10,000 inclusive and increment by one for each part.sha1_checksum: The SHA1 checksum of this part of the file. You may passNoneto defer verification until finishing the file.data: The data part of the file.
Uploading a file part without a checksum is not recommended as it prevents B2 from determining if the file part is corrupt, allowing you to immediately retry.