Developer tools

Content-Disposition header generator

Build an HTTP download or inline header with an ASCII fallback filename and a correctly encoded Unicode filename.

Content-Disposition header generator
Esc to restore

Your inputs

A name, not a path. Up to 255 UTF-8 bytes after trimming. Control characters and path separators are rejected.

Printable ASCII without quotes, percent signs or path separators. If blank, accents are removed and unsupported characters become underscores. Up to 255 characters.

Results update as you type. Larger files run when you press Update result.

Your result

Your result will appear here.

More actions

Your inputs stay in this browser. Nothing is uploaded, and nothing is saved unless you choose “Save result”.

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
  1. 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
  2. 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
  3. 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
  4. 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.