Content-Disposition Builder
Build the header that names a download, or paste one and read the filename back. The rules match the ones Express uses for res.download().
The filename stays in the browser. A short name can be stored in the page URL so you can share the form. The pasted header is not stored.
Build a header
Type
Copy uses the full header line, including the field name.
Not built
Header
Read a header
Not parsed
Decoded filename
About this tool
attachment asks the browser to save the file.inline asks it to show the file when it can, such as a PDF in the tab. The filename parameter is a quoted string. A quote or a backslash inside the name is escaped.
A character outside Latin-1, such as the euro sign, cannot live in that quoted string. The page then sends filename with ? in its place, andfilename* with the UTF-8 name, percent-encoded, as defined in RFC 8187. When both are present, filename* is the one to use.
A path is reduced to the last segment. reports/invoice.pdf becomesinvoice.pdf. The header names a file. It does not choose a folder on the visitor's disk.
Read more
Free books, courses, and software
Get my programming books, course editions, and complete software.
Get the download library →