Content-Disposition filename decoder
Decode filename and filename* from a Content-Disposition header.
What it does, how to use it, and questions
What it does
Content-Disposition tells the browser whether to display or download, and under which filename. filename* carries an RFC 5987 UTF-8 value when the plain filename cannot.
How to use it
- Paste the header.
- Read type, filename and filename*.
- Resolve conflicts when both are present.
Things to watch for
- Some clients ignore filename* or prefer filename. Test the browsers you support.
- Quoted filenames may still contain escapes.
Questions
- What does attachment mean?
- Suggest download rather than inline display.
- Why is my UTF-8 name garbled?
- You need filename* with UTF-8 encoding, not only filename.
- Does this download a file?
- No. It only parses the header text.
- Is the header uploaded?
- No.