Apache OpenDAL™ - v0.49.0
    Preparing search index...

    Interface WriteOptions

    interface WriteOptions {
        append?: boolean;
        cacheControl?: string;
        chunk?: bigint;
        concurrent?: number;
        contentDisposition?: string;
        contentEncoding?: string;
        contentType?: string;
        ifMatch?: string;
        ifNoneMatch?: string;
        ifNotExists?: boolean;
        userMetadata?: Record<string, string>;
    }
    Index

    Properties

    append?: boolean

    Append bytes into a path.

    • It always appends content to the end of the file.
    • It will create file if the path does not exist.
    cacheControl?: string

    Set the Cache-Control of op.

    chunk?: bigint

    Set the chunk of op.

    If chunk is set, the data will be chunked by the underlying writer.

    A service could have their own minimum chunk size while perform write operations like multipart uploads. So the chunk size may be larger than the given buffer size.

    concurrent?: number

    Sets concurrent of op.

    • By default, OpenDAL writes files sequentially
    • When concurrent is set:
      • Multiple write operations can execute in parallel
      • Write operations return immediately without waiting if tasks space are available
      • Close operation ensures all writes complete in order
      • Memory usage increases with concurrency level
    contentDisposition?: string

    Set the Content-Disposition of op.

    contentEncoding?: string
    contentType?: string

    Set the Content-Type of op.

    ifMatch?: string

    Sets if-match condition of op.

    This operation provides conditional write functionality based on ETag matching, helping prevent unintended overwrites in concurrent scenarios.

    ifNoneMatch?: string

    Sets if-none-match condition of op.

    This operation provides conditional write functionality based on ETag non-matching, useful for preventing overwriting existing resources or ensuring unique writes.

    ifNotExists?: boolean

    Sets if_not_exists condition of op.

    This operation provides a way to ensure write operations only create new resources without overwriting existing ones, useful for implementing "create if not exists" logic.

    userMetadata?: Record<string, string>

    Sets user metadata of op.

    If chunk is set, the user metadata will be attached to the object during write.

    • Services may have limitations for user metadata, for example:
      • Key length is typically limited (e.g., 1024 bytes)
      • Value length is typically limited (e.g., 4096 bytes)
      • Total metadata size might be limited
      • Some characters might be forbidden in keys