Content-Disposition header generator
Build an HTTP download or inline header with an ASCII fallback filename and a correctly encoded Unicode filename.
A clear answer. Here’s how.
Produces an HTTP response Content-Disposition field with a quoted ASCII filename followed by filename*. The extended value uses UTF-8 bytes, uppercase percent escapes and the RFC 8187 attribute-character set; spaces become %20, not plus signs. Surrounding filename whitespace is trimmed, but its Unicode spelling is otherwise preserved. A blank fallback uses NFKD decomposition, removes combining marks and substitutes underscores for non-ASCII characters, quotes, percent signs and path separators; an empty result becomes download. You can supply your own ASCII fallback. Both names are limited to 255 UTF-8 bytes, a practical tool limit rather than an HTTP limit. Controls, path separators, dot-only names and malformed Unicode are rejected. Attachment suggests downloading; inline permits normal display. Browser handling and saved names vary. This is a response-header generator, not multipart form-data syntax, a Content-Type detector or a validator for every operating system filename rule. Everything is generated locally.
How this is checked
4 reference checks passed These 4 cases were run when this page was built, on 3 December 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.
See the checks and where each expected answer comes from
Case 1
- Inputs
- Download filename € ratesASCII fallback filename (optional) EURO rates
- Expected, and what Toolmoz gave
- text expected Content-Disposition: attachment; filename="EURO rates"; filename*=UTF-8''%E2%82%AC%20rates, Toolmoz Content-Disposition: attachment; filename="EURO rates"; filename*=UTF-8''%E2%82%AC%20rates
- Where the expected answer comes from
- RFC 6266 section 5 euro-rates example, serialized on one line with equivalent uppercase hexadecimal escapes.
- Allowed difference
- exact
Case 2
- Inputs
- Download filename £ and € ratesASCII fallback filename (optional) GBP and EUR ratesOutput value
- Expected, and what Toolmoz gave
- text expected attachment; filename="GBP and EUR rates"; filename*=UTF-8''%C2%A3%20and%20%E2%82%AC%20rates, Toolmoz attachment; filename="GBP and EUR rates"; filename*=UTF-8''%C2%A3%20and%20%E2%82%AC%20rates
- Where the expected answer comes from
- RFC 8187 section 3.2.3: pound uses UTF-8 C2 A3, euro uses E2 82 AC and spaces use percent 20; adapted to the filename parameter.
- Allowed difference
- exact
Case 3
- Inputs
- Download filename report.pdfDisposition inline
- Expected, and what Toolmoz gave
- text expected Content-Disposition: inline; filename="report.pdf"; filename*=UTF-8''report.pdf, Toolmoz Content-Disposition: inline; filename="report.pdf"; filename*=UTF-8''report.pdf
- Where the expected answer comes from
- RFC 6266 inline disposition with an ASCII filename; all characters in report.pdf belong to the RFC 8187 attr-char set.
- Allowed difference
- exact
Case 4
- Inputs
- Download filename résumé.csv
- Expected, and what Toolmoz gave
- text expected Content-Disposition: attachment; filename="resume.csv"; filename*=UTF-8''r%C3%A9sum%C3%A9.csv, Toolmoz Content-Disposition: attachment; filename="resume.csv"; filename*=UTF-8''r%C3%A9sum%C3%A9.csv
- Where the expected answer comes from
- Each e-acute encodes as UTF-8 C3 A9. NFKD separates its accent for the automatic ASCII fallback; the original extended filename is preserved.
- Allowed difference
- exact
What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.
See a worked example
Worked example
A fixed demonstration, separate from the values you enter above.
- Download filename
- € rates.pdf
- ASCII fallback filename (optional)
- Disposition
- Attachment (suggest a download)
- Output
- Complete HTTP header
Example result
Content-Disposition: attachment; filename="_ rates.pdf"; filename*=UTF-8''%E2%82%AC%20rates.pdf
Copy this into an HTTP response header. The ASCII filename is the compatibility fallback; filename* carries the original trimmed name in UTF-8. Suggested filenames are advisory: browsers can adjust them. Use a filename extension and Content-Type appropriate to your actual response. This tool does not send a response or create a downloadable resource.