Setu-TS
    Preparing search index...

    Interface UploadMiddlewareOptions

    Options for the upload middleware factory.

    0.1.0

    interface UploadMiddlewareOptions {
        allowedMimeTypes?: readonly string[];
        fieldname?: string;
        maxBodyBytes?: number;
        maxFiles?: number;
        maxSize?: number;
    }
    Index
    allowedMimeTypes?: readonly string[]

    Allowed MIME-type allow-list (optional).

    fieldname?: string

    Form field name to extract (default 'file').

    maxBodyBytes?: number

    Hard ceiling, in bytes, on the request body this middleware will PARSE (default 50 MB). The effective bound is min(maxSize * 2 + framing allowance, maxBodyBytes), so raising maxSize raises the bound only up to this ceiling.

    It bounds the parse THIS middleware triggers and the per-part copies that parse produces — not the initial read. Nothing is read ahead of the first consumer since the body became memoized-lazy in the HTTP adapter (M87), and RuntimePlugin({ maxBodyBytes }) (M90a) bounds the read itself — that runtime bound is the one covering every reader, including a CSRF middleware that parsed the same form before this middleware ran (M94b), which is why this parse is no longer necessarily the request's first. The read still cannot be declined: IRequest exposes no body stream, so capping it for every reader needs a streaming request body, a framework-level change.

    0.3.0

    maxFiles?: number

    Maximum number of files (default unlimited).

    maxSize?: number

    Maximum per-file size in bytes (default 10 MB).