Content-Disposition Parser & Generator
Parse or generate inline and attachment headers with filename and RFC 5987 filename* support
Parsed or generated output will appear here.
About this tool
Content-Disposition Parser and Generator inspects inline or attachment headers and their parameters, including quoted filename and RFC 5987 filename*. Parse mode splits parameters without breaking quoted semicolons, unescapes quoted filename, decodes UTF-8 extended values, prefers a valid filename* as the effective filename, records duplicate parameters, and warns about path separators or CR/LF characters that must not be trusted as filesystem paths. Generate mode creates an ASCII fallback filename plus an optional UTF-8 filename* value for international names. Header parsing does not sanitize a download path, verify MIME type, enforce browser behavior, or guarantee compatibility with every legacy user agent. Always discard directory components and apply application-specific filename policy before saving.
Scenario Recipes
Debug a multilingual download filename across browsers
Goal: Separate header encoding from filesystem safety and user-agent behavior
- Parse the captured response header and compare filename, filename*, and the reported effective value.
- Generate a controlled header with an ASCII fallback and UTF-8 filename*, then test it in the supported browser matrix.
- Apply server-side path stripping and filename policy independently before enabling production downloads.
Result: A standards-oriented header with compatibility and filesystem safety tested as separate concerns.
Frequently Asked Questions
What is the difference between filename and filename*?
filename is usually a quoted fallback, while filename* carries charset and percent-encoded international text under RFC 5987.
Which filename takes precedence?
A valid decoded filename* is reported as effective; filename remains visible as the compatibility fallback.
Can I use the parsed filename directly on disk?
No. Strip path components, reject control characters, and apply your application's allowlist and collision policy.
Does parse mode handle quoted semicolons?
Yes. Parameter splitting tracks quoted strings so a semicolon inside a quoted filename is not treated as a separator.
What does generate mode emit?
It emits inline or attachment, an escaped ASCII fallback filename, and optionally UTF-8 filename*.
Is header data uploaded?
No. Parsing, encoding, warnings, and copying happen locally.
Keep browsing