Content-Disposition Filename Encoder

Type any download filename and get a Content-Disposition header that carries it: an ASCII filename fallback first, then an RFC 8187 filename*=UTF-8''... value, with each step and its rule shown. The second mode parses a pasted header the way RFC 6266 tells recipients to, and sets a reading of Chromium's parser beside it. The sender follows RFC 6266 Appendix D, the receiver follows RFC 6266 section 4.3 and its own legacy behaviour, and the bytes in between are where filenames break.

1. Build a header

Step 1: sanitise (RFC 6266 4.3 recipient advice, applied by the sender)
ASCII fallback for the plain filename
Fallback hazards (RFC 6266 Appendix D)

2. Parse a header

Both modes also update as you type.

3. Self test

Every worked example is built and then parsed back, and must round-trip to the exact NFC name. Also covered: all 95 printable ASCII characters against the attr-char rule, the encodeURIComponent contrast, a lone surrogate, duplicate parameters, an ISO-8859-1 value, a malformed escape and the Chromium reading. The last row is a positive control written to fail; if it ever holds, the suite is not really running.

4. Scope

  • filename* uses ext-value as defined by RFC 8187, which obsoletes RFC 5987 cited by RFC 6266.
  • The Chromium column is a reading of net/http/http_content_disposition.cc as it stood when this page was built, not a test of any browser. Nothing is claimed about Firefox or Safari internals.
  • Whether a file extension is dangerous, or matches the content, is not judged here.
  • Length: a name over 255 UTF-8 bytes gets a note only; operating system limits are covered by filename-and-path-limits-reference.

This is an independent tool. It is not affiliated with or endorsed by the IETF, Google, Mozilla, Apple or MDN.