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

    Interface PresignS3PutObjectUrlOptions

    Options for presignS3PutObjectUrl.

    interface PresignS3PutObjectUrlOptions {
        accountInfo: AccountInfo;
        allowBrowserExecutableContentType?: TrustedUnsafeS3PresignOptIn;
        applicationKey: string;
        applicationKeyId: string;
        bucketName: string;
        contentLength?: number;
        contentType?: string;
        expiresIn?: number;
        fileName: string;
        metadata?: Record<string, string>;
        region?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    accountInfo: AccountInfo

    The authorized AccountInfo containing the S3 endpoint URL.

    allowBrowserExecutableContentType?: TrustedUnsafeS3PresignOptIn

    Permit browser-executable contentType values such as text/html, JavaScript, SVG, or XML media types. Leave this unset unless the uploaded object is intentionally meant to render active content from the storage origin. Pass trustedUnsafeS3PresignOptIn; plain booleans from request JSON are intentionally ignored by the runtime guard.

    applicationKey: string

    B2 application key (secret). Used as the S3 secretAccessKey.

    applicationKeyId: string

    B2 application key ID. Used as the S3 accessKeyId.

    bucketName: string

    Bucket containing the object.

    contentLength?: number

    Optional content length. Must be a non-negative safe integer. When supplied, the generated URL signs the Content-Length header, so upload clients must send the same value.

    contentType?: string

    Optional content type for the uploaded object. When supplied, the generated URL signs the Content-Type header, so upload clients must send the same value. Browser-executable and sniffable XML/JavaScript types are rejected by default as a best-effort guard; callers accepting untrusted uploads should still enforce their own allow-list.

    expiresIn?: number

    URL validity duration in seconds. Defaults to 3600. Must be an integer from 1 to 604800 (7 days), the AWS Signature Version 4 presign maximum. A presigned URL is a bearer credential for the signed operation; keep this as short as the calling workflow allows.

    fileName: string

    Object key / B2 file name to sign. Keys with path segments exactly . or .. cannot be presigned safely because common URL parsers normalize them before sending the request.

    metadata?: Record<string, string>

    Optional user metadata to attach to the object. The generated URL signs matching x-amz-meta-* headers, so upload clients must send the same values. Pass bare metadata keys; the helper adds the x-amz-meta- prefix. Metadata keys must be valid HTTP header tokens and must not differ only by case.

    region?: string

    Override the S3 region. If omitted, extracted from the S3 API URL.