If source is a plain file path (no glob metacharacters and the path
exists as a regular file), upload that single file. The B2 file name is
destination if set; otherwise basename(source).
Otherwise treat source (plus any include patterns) as glob(s). Each
matched file is uploaded preserving its path relative to the glob root,
prefixed by destination (default empty).
Large files are streamed (StreamSource over a fs ReadStream-as-Web-Stream)
so we don't buffer the whole payload in RAM. The SDK's Bucket.upload
routes to multipart automatically when size exceeds the recommended part
size and parallelizes parts up to concurrency.
Upload one or more files to B2.
Mode selection:
sourceis a plain file path (no glob metacharacters and the path exists as a regular file), upload that single file. The B2 file name isdestinationif set; otherwisebasename(source).source(plus anyincludepatterns) as glob(s). Each matched file is uploaded preserving its path relative to the glob root, prefixed bydestination(default empty).Large files are streamed (StreamSource over a fs ReadStream-as-Web-Stream) so we don't buffer the whole payload in RAM. The SDK's
Bucket.uploadroutes to multipart automatically when size exceeds the recommended part size and parallelizes parts up toconcurrency.