Sanity Library Reference Docs
    Preparing search index...

    Type Alias FileUploadBeta

    A file for a files source. The client stages an upload, PUTs the bytes straight to storage with a signed URL, and starts the source's sync with it. The Context API never holds the file content.

    type FileUpload = {
        contentType?: string;
        file: Exclude<UploadBody, NodeJS.ReadableStream>;
        filename: string;
    }
    Index

    Properties

    contentType?: string

    When set, the bytes are PUT with this Content-Type.

    file: Exclude<UploadBody, NodeJS.ReadableStream>

    Same shapes assets.upload accepts, minus node streams: the bytes go out through fetch, which has no portable stream support. A single document, or a zip, tar or gzip archive of them.

    filename: string