
log ) Feature introduction Upload token managementī2 requires a separate upload URL and authorization token for each concurrent upload request re-using a token that is currently being used by an outstanding request will return a 400 error. uploadAny = require ( ) const b2 = new B2 (, console. This is necessary to facilitate retries when a token expires.)Ĭonst B2 = require ( 'backblaze-b2' ) B2. (When the data is provided as a stream, some sections of the stream may be buffered in memory. Automatic large-file uploads: If uploaded data is larger than a specified threshold, it will be automatically uploaded in multiple pieces using B2's large file APIs.This case has unique optimizations not possible with stream objects. File support: Files on disk can be uploaded.Stream support: Uploaded files can be provided as streams.The interrupted upload will be transparently retried. Automatic re-authorization: A 401 error will cause automatic re-authorization.The retry-after HTTP response header is respected. Consecutive errors will result in exponential backoff. Intelligent auto-retry: If the destination pod is too busy to receive an upload, it will automatically be retried after obtaining a new upload token.

Upload token management: Maintains a bucket of previously-used upload tokens that can be reused for future requests, allowing vastly-simplified parallel uploads without having to manually manage upload tokens.This function can upload buffers, streams, and local files, and automatically uses B2's large file upload mechanism when appropriate. Intelligent upload function to be used with the backblaze-b2 module.
