Skip to content

Main content

HTTP Contentdisposition Filename Parameter Tool

Compute http contentdisposition filename parameter from explicit bounded inputs.

Loading tool…

Description

Unescape backslash pairs in quoted values and return filename and quoted.

HTTP fields use specific token, quoted-string, range, quality-weight, and entity-tag grammars. Quoted text is not automatically safe as a filename or equivalent to an escaped string in another language. Parsing one parameter or marker is separate from interpreting a full request or response.

Unescape backslash pairs in quoted values and return filename and quoted.

When to use this tool

Use HTTP Contentdisposition Filename Parameter when you need to parse this one supported HTTP field component or parameter token.

How to use the tool and how it works

  1. Enter parameter. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read filename, quoted. Inspect quoted before interpreting the associated values.

Accept a case-insensitive filename= parameter followed by a token value or supported double-quoted value. Unescape backslash pairs in quoted values and return filename and quoted.1

Input fieldMeaning and unitsAccepted input
parameterParameterRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
filenameUnescaped supplied filename text; not sanitized for filesystem use.Required. Text; maximum UTF-16 length 8192.
quotedQuotedRequired. Boolean.
json
{
  "input": {
    "parameter": "filename=\"report 1.txt\""
  },
  "output": {
    "filename": "report 1.txt",
    "quoted": true
  }
}

Limitations and assumptions

  • Extended filename* parameters are unsupported. Returned names are unsanitized text and may contain path-like or other unsafe-to-use characters; the tool does not authorize filesystem use, validate a full header, or save a file.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use a full header parser and the relevant HTTP semantics when request behavior depends on the result. Check extended parameters, field context, and downstream use of returned text separately.

References

  1. Calculation and input contract: parse/http-contentdisposition-filename-parameter — tool.io

Similar or alternative tools