@b-jones-rfd/sp-rest-connect - v5.1.1
    Preparing search index...

    Type Alias AddDocumentToLibraryOptions

    AddDocumentToLibraryOptions: AuthenticatedRequestOptions & {
        contentLength?: number;
        fileName: string;
        folder: string;
        payload: Buffer | Readable;
    }

    Type Declaration

    • OptionalcontentLength?: number

      Byte length of a Readable payload, if known. Ignored for Buffer.

    • fileName: string

      File name, including extension. An existing file with the same name is overwritten.

    • folder: string

      Target folder path relative to serverRelativeUrl, starting with the library name (e.g. 'Shared Documents/Reports').

    • payload: Buffer | Readable

      File contents. A Readable (e.g. fs.createReadStream(path)) is piped to SharePoint without buffering it in memory. A stream can only be sent once, so a 403 for a stale managed digest is not retried for streams; supply contentLength when you know it, otherwise the upload is chunked.