@fastify/multipart
Multipart form data parser for Fastify with streaming file handling, field limits, and save-to-disk or in-memory options.
Official Documentation ↗v10.1.7. Check the official docs for the latest API surface.Installation
npm install @fastify/multipartMethods
No methods match this filter.
@fastify/multipart is multipart form data parser for fastify with streaming file handling, field limits, and save-to-disk or in-memory options. This page documents the core methods, installation, and common usage patterns for the current stable release.
Installation
Install @fastify/multipart with your preferred package manager using the command shown in the frontmatter. The package is published to the npm registry and ships with TypeScript types where applicable.
Core methods
The methods listed in the frontmatter cover the primary API surface. Each signature reflects the v9.0 release. Consult the official documentation linked in sourceUrl for advanced options, edge cases, and breaking changes between major versions.
Frequently asked questions
The faq section in the frontmatter answers the most common questions about @fastify/multipart, including comparisons with alternatives, configuration tips, and runtime requirements. If your question is not covered, check the source URL for the full guide.
Errors
The following points are quoted verbatim from the official documentation. 来源:https://cdn.jsdelivr.net/gh/fastify/fastify-multipart@latest/README.md · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:49:36.169Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.
- Access all errors We export all custom errors via a server decorator fastify.multipartErrors. (https://cdn.jsdelivr.net/gh/fastify/fastify-multipart@latest/README.md)
- They are derived from @fastify/error and include the correct statusCode property. (https://cdn.jsdelivr.net/gh/fastify/fastify-multipart@latest/README.md)
FAQ
- Does it stream files?
- Yes. request.file() returns a Node stream; pipe it to avoid buffering large uploads.
- How do I limit fields?
- Set limits: { fields, fieldSize, fileSize, parts } in the plugin options.
- Can I store in memory?
- Use file.toBuffer() for small files; for large ones, stream to disk or S3.
Report a problem with this API docOpens a pre-filled issue on GitHub.