Home

ContentDisposition

ContentDisposition refers to the Content-Disposition header field used in MIME and HTTP to describe how content should be handled or presented by a user agent. In HTTP responses, this header guides how the payload is treated by the browser: inline suggests the content can be displayed within the page, while attachment indicates the content should be offered for download or saved to disk. A filename parameter may accompany these directives to suggest a default file name, for example, Content-Disposition: attachment; filename="report.pdf". Values are typically tokens or quoted strings, and non-ASCII names can be conveyed using encoded forms such as filename* per related standards.

In multipart/form-data, which is used for form submissions that include file uploads, Content-Disposition appears on each

Standards and evolution: The header field originated in MIME with RFC 2183 and was later updated for

Practical considerations include correct handling of quoted parameters, safe and sanitized filenames, and awareness of how

part.
A
common
form
is
form-data;
name="field";
filename="example.txt",
where
the
name
parameter
identifies
the
form
field
and
the
filename
parameter
provides
the
client-supplied
file
name.
The
part
may
also
include
a
Content-Type
for
the
uploaded
file.
HTTP
use
in
RFC
6266.
For
form
uploads,
the
multipart/form-data
semantics
are
described
in
RFC
2388.
Real-world
usage
varies
across
clients
and
servers,
especially
regarding
encoding
of
non-ASCII
filenames
and
cross-browser
compatibility.
different
user
agents
may
honor
or
override
the
directives
when
downloading
or
displaying
content.