Expand description
Multipart form data parser.
This module provides streaming parsing of multipart/form-data requests,
which is the standard encoding for file uploads.
§Format
Multipart form data consists of multiple parts separated by a boundary string:
--boundary\r\n
Content-Disposition: form-data; name="field1"\r\n
\r\n
value1\r\n
--boundary\r\n
Content-Disposition: form-data; name="file"; filename="example.txt"\r\n
Content-Type: text/plain\r\n
\r\n
file contents...\r\n
--boundary--\r\n§Features
- Streaming parser that doesn’t buffer entire body
- Per-file and total size limits
- Extracts filename, content-type, and field name
- Memory-safe: enforces limits before allocating
Structs§
- Multipart
Config - Configuration for multipart parsing.
- Multipart
Form - Parsed multipart form data.
- Multipart
Parser - Streaming multipart parser.
- Part
- A parsed multipart form part.
- Upload
File - An uploaded file with metadata.
Enums§
- Multipart
Error - Errors that can occur during multipart parsing.
Constants§
- DEFAULT_
MAX_ FIELDS - Default maximum number of fields.
- DEFAULT_
MAX_ FILE_ SIZE - Default maximum file size (10MB).
- DEFAULT_
MAX_ TOTAL_ SIZE - Default maximum total upload size (50MB).
Functions§
- parse_
boundary - Parse boundary from Content-Type header.