Multipart Forms
When browsers submit forms with file inputs, they encode the data asmultipart/form-data — a format that bundles multiple fields (text and binary) into a single HTTP body. Prism parses this format natively, giving you typed access to each part.
How Multipart Works
A multipart request body is split by a boundary string into parts. Each part has headers (name, filename, content type) and a body. Prism handles the boundary parsing and gives you a clean array of parts.Basic Multipart Parsing
Text Fields vs File Parts
The key difference: file parts have afilename, text fields don’t.
Separating Fields and Files
Contact Form Example
Contact Form with Attachment
HTML Form
Browser Form
Each multipart part’s
data property contains the raw bytes. For text fields, use stringValue which decodes the data as UTF-8. For files, work with data directly or use the upload processor.