Build and parse Content-Disposition headers, with non-ASCII filenames handled through the RFC 5987 extended form rather than mangled or dropped.
Built
Plain ASCII, so one form is enough.
Try a name with an accent, an emoji or a quote in it. Each one needs different handling, and all three are what real filenames contain.
inline is not a security boundary. An HTML file served inline from your origin runs as your origin — for user uploads, use attachment with nosniff.
Content-Disposition: attachment; filename="quarterly report.pdf"
Every character is plain ASCII, so the plain parameter is enough and every client will read it the same way.
Content-Disposition Builder runs entirely on your device — nothing is uploaded.
You’re on the Free plan. Compare plans
HTTP header values are Latin-1 by specification, and filenames are not. A plain `filename="résumé.pdf"` is not representable, so anything outside Latin-1 has to go in the RFC 5987 extended form: `filename*=UTF-8''r%C3%A9sum%C3%A9.pdf`.
Both forms are sent together, which looks redundant and is not. Older clients read `filename` and ignore the parameter they do not understand; current ones prefer `filename*`. Sending only the extended form loses the old clients, and sending only the plain one loses the characters.
The filename is a suggestion rather than a path. A browser takes the basename and applies its own rules, and directory separators and traversal sequences are stripped here rather than passed through — a server that reflects a user-supplied name into this header is one of the ways a download lands somewhere it should not.
`inline` is not a security boundary. It asks the browser to render rather than download, and an HTML file served inline from your origin runs as your origin. For user-uploaded content, `attachment` together with `X-Content-Type-Options: nosniff` is the combination that matters.
The parse view reports which filename a browser will actually use when both forms are present, which is the question people have when a download arrives with the wrong name.
Because header values are Latin-1 and filenames often are not. `filename` carries an ASCII fallback for older clients; `filename*` carries the real name as UTF-8 per RFC 5987. Current browsers prefer the extended form.
`filename*` when it is present and valid, otherwise `filename`. That is why sending both works: each client takes the one it understands.
No. Inline asks the browser to render the file, and an HTML file rendered from your origin runs as your origin with access to your cookies. Use attachment, and send `X-Content-Type-Options: nosniff` alongside.
It should not, and one is stripped here. The parameter is a suggested name, not a location. Reflecting a user-supplied value into this header without stripping separators is a real vulnerability.
They have to be escaped inside the quoted string, and a filename containing a quote or a semicolon is where naive string concatenation produces a header that parses as something else entirely.