Initializes a new B2Upload class
Instance of the B2 client library. It's expected authorization to be completed already, so auth data is stored in the library.
Id of the target bucket
Path where to store the object, inside the container
Data to upload
Metadata for the object
Length (in bytes) of the input data
Id of the target bucket
Instance of the B2 client library
Data to upload
Length (in bytes) of the input data
Metadata for the object
Path where to store the object, inside the container
Size of each chunk that is uploaded when using B2's large file APIs, in bytes. Minimum value is 5MB; default is 9MB.
Note: there seems to be a bug in the current version of the backblaze-b2 package when the request body upload is > 10 MB, because of a downstream dependency on axios@0.17; once backblaze-b2 updates its dependency on axios, this might be fixed.
Backblaze recommends retrying all uploads at least two times (up to five) in case of errors, with an incrementing delay. We're retrying all uploads 3 times by default.
Uploads a single file, when data is a Buffer or string.
Data to upload, as Buffer. If not specified, will use this.data
Promise that resolves when the object has been uploaded
Uploads a Readable Stream.
Readable Stream containing the data to upload
Promise that resolves when the object has been uploaded
Uploads a single part of a large file.
ID of the large file that is being uploaded
Number of the part, starting from 1
Data to upload, in a Buffer
Promise that resolves when the part has been uploaded.
Start the upload of the object
Promise that resolves when the object has been uploaded
Generated using TypeDoc
Manages the upload of objects to Backblaze B2.
This supports using Buffers and strings with the "simple APIs". It supports streams too, using either the "simple APIs" if the stream is less than
chunkSize
, or the large file APIs otherwise. The selection happens automatically.