@backblaze-labs/b2-sdk - v0.2.0
    Preparing search index...

    Interface BucketUploadOptions

    Options accepted by Bucket.upload.

    interface BucketUploadOptions {
        concurrency?: number;
        contentType?: string;
        fileInfo?: Record<string, string>;
        fileName: string;
        fileRetention?: FileRetentionValue;
        lastModifiedMillis?: number;
        legalHold?: LegalHoldValue;
        onCleanupFailure?: CleanupFailureListener;
        onProgress?: ProgressListener;
        onResumeCandidateRejected?: ResumeCandidateRejectedListener;
        onResumePartReused?: ResumePartReusedListener;
        onUploadRetry?: UploadRetryListener;
        partSize?: number;
        resume?: boolean;
        resumeDiscoveryTimeoutMs?: number;
        resumeFileId?: LargeFileId;
        resumeMaxListPages?: number;
        resumeMaxPartCandidates?: number;
        resumeMaxPartPages?: number;
        retry?: Partial<RetryOptions>;
        retryResponseBodyFailures?: boolean;
        serverSideEncryption?: EncryptionSetting;
        signal?: AbortSignal;
        source: ContentSource;
    }

    Hierarchy (View Summary)

    Index

    Properties

    concurrency?: number

    Number of concurrent part uploads for large files.

    contentType?: string

    MIME type. Defaults to "b2/x-auto" (auto-detected by B2).

    fileInfo?: Record<string, string>

    Custom key-value metadata stored with the file.

    fileName: string

    Destination file name (path) in the bucket.

    fileRetention?: FileRetentionValue

    File retention policy (requires file lock on the bucket).

    lastModifiedMillis?: number

    Last-modified timestamp in milliseconds since epoch.

    legalHold?: LegalHoldValue

    Legal hold status for the file.

    onCleanupFailure?: CleanupFailureListener

    Callback invoked if best-effort cancellation fails, or if cancellation is skipped because b2_finish_large_file may already have committed.

    onProgress?: ProgressListener

    Callback invoked with upload progress events.

    onResumeCandidateRejected?: ResumeCandidateRejectedListener

    Diagnostic callback invoked when resume discovery rejects a candidate.

    onResumePartReused?: ResumePartReusedListener

    Diagnostic callback invoked when resume reuses an already-uploaded part.

    onUploadRetry?: UploadRetryListener

    Callback invoked before a fresh-URL upload retry.

    partSize?: number

    Part size override for multipart uploads, in bytes.

    resume?: boolean

    Enable bounded same-name multipart resume discovery. Ignored on the small-file path.

    resumeDiscoveryTimeoutMs?: number

    Optional aggregate SDK-enforced timeout for resume discovery.

    resumeFileId?: LargeFileId

    Explicit unfinished large-file ID to verify and resume. Only supported on the large-file path; small-file uploads throw.

    resumeMaxListPages?: number

    Maximum b2_list_unfinished_large_files pages inspected before upload starts.

    resumeMaxPartCandidates?: number

    Maximum metadata-compatible candidates whose parts may be listed before upload starts.

    resumeMaxPartPages?: number

    Maximum b2_list_parts pages inspected per metadata-compatible candidate.

    retry?: Partial<RetryOptions>

    Retry settings shared with the main transport retry configuration.

    retryResponseBodyFailures?: boolean

    Whether ambiguous failures after an upload POST should be retried, including response-body read failures and transport errors where B2 may have stored the payload before the success response was lost. Defaults to false. Set true only when duplicate versions or parts are acceptable.

    serverSideEncryption?: EncryptionSetting

    Server-side encryption settings.

    signal?: AbortSignal

    Abort signal for cancelling the upload.

    Data source to upload. Use BufferSource, BlobSource, FileSource, StreamSource, or toContentSource for async iterables and Node Readables.