RTCForge API Reference v1.1.1
    Preparing search index...

    StorageSink that writes received bytes directly to a file on the Node filesystem.

    Chunks are written at absolute offsets through an fs.promises file handle, so files never need to be buffered in memory. Node-only; import from rtcforge-sdk/filetransfer/node.

    Implements

    Index

    Constructors

    Methods

    • Create a sink that writes into dir, deriving the file name from the transfer metadata with sanitizeFileName applied automatically. This neutralizes path-traversal / absolute names (../../etc/passwd, C:\evil) from a hostile peer by default, so the written file can never escape dir.

      Parameters

      • dir: string

        Destination directory the received file is written into.

      Returns NodeFileSink