interface FormFile
Since 0.5.0

One file part of a form body: a field that declared a filename in its Content-Disposition.

filename is present exactly when the part declared one — an empty string still counts, because an empty <input type="file"> sends filename="" and the web standard reports a (nameless) File for it. The bytes are the parser's own synchronous view — no await, no copy. size is deliberately omitted: data.byteLength is the same number.

Properties

readonly
filename: string

The client-provided file name (Content-Disposition filename="…").

readonly
mimeType: string

MIME type reported by the part's Content-Type, or its default.

readonly
data: Uint8Array

The file bytes, synchronously.

Usage

import { type FormFile } from "common/src/index.ts";