Visual RFC.
ALL RFCs / RFC 7578
Read the RFC ↗
RFC 7578 / MULTIPART FORM DATA

Name the part; distrust the filename

02

A part header connects its data to a form field. A supplied filename is metadata from the sender, not an instruction to choose a destination path.

RFC 7578 · § 4.2EXAMPLE
4 / 4
04
Separate a supplied name from storage.

The receiver retains the field mapping but ignores directory information in the supplied filename. A local policy chooses a storage identifier and checks the contents before use; the RFC provides no automatic upload safety.

Name the part; distrust the filenameThe receiver retains the field mapping but ignores directory information in the supplied filename. A local policy chooses a storage identifier and checks the contents before use; the RFC provides no automatic upload safety.The application chooses storagename="upload"filename="../notes.txt"Content-Type: application/octet-streamDirectory information is not usedApplication policy: choose a local identifierCheck contents and overwrite risk separately

Key idea: Each part MUST have Content-Disposition: form-data with a name parameter.

Terms

Look up a term in the glossary ↗

Rules & examples
  • Content-Disposition is a part header, inside the multipart body. Its form-data disposition and name parameter are both required. The name identifies the original form field; it does not identify or authenticate a person.
  • For file contents, a filename SHOULD be supplied when meaningful and available. It is not mandatory when unavailable, meaningless or private. A missing filename is different from a missing required name parameter.
  • Content-Type is optional for a part and defaults to text/plain. A file SHOULD use an appropriate media type if known, or application/octet-stream when not known. The label does not establish that the content is safe.
  • Receivers must not use a supplied filename blindly or use directory path information. RFC 2183 section 2.3 requires checking local conventions, overwrite risk and security. Application storage and authorization policies are outside this format.
  • A filename such as ../notes.txt must not select a parent directory. The example application chooses its own local storage identifier and performs separate content checks. No filesystem write or general filename sanitizer is implemented here.

The missing-name state illustrates a sender-side construction failure, not a new requirement that every receiver emit a particular error. The storage identifier is an explanatory application choice; it is not an RFC wire field or a promise of a complete safe-upload implementation.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A message needs an address.

Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

All chapters in RFC 7578

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗