In this article
Decode the supported filename parameter for display, preserve its provenance and use application-owned artifact identity rather than a localized label for document associations.
Explain why the visible names differ
An enterprise assistant downloads a report with an internationalized filename and an ASCII fallback. A browser shows the expressive name while a connector stores the fallback; later the application treats them as different reports or attaches a result to another same-named upload. The mismatch can arise without changed response bytes. Keep presentation decoding separate from the identity used to join a document, its extracted text and the assistant’s final evidence.
Select the parameter under its documented contract
The Content-Disposition standard describes filename as a compatibility form and filename* as the encoded extended form. When both are supplied, recipients supporting the extended form should prefer it. Preserve which parameter the adapter actually used. Splitting the header at every semicolon without a proper parser can mishandle quoted values, so use an implementation that understands the field syntax rather than a filename regular expression shared with unrelated headers.
Decode characters without changing identity
The extended-parameter standard defines encoding and language information and requires UTF-8 support. Decode the parameter according to that grammar, retaining a visible failure classification for malformed escape sequences. Do not repeatedly percent-decode an already decoded label or silently replace an invalid name with another document’s existing key. A display fallback can be useful, but the application must distinguish that fallback from a successfully decoded server-provided name.
Allocate storage independently of the label
Content-Disposition treats the proposed filename as advisory. Let an application-owned artifact identifier select the stored object, while the decoded label remains metadata. Preserve source location, response association and trusted integrity evidence separately. Sanitization can also make distinct labels collapse to the same local filename; never interpret that collision as proof that the uploads are equivalent. Choose a documented collision policy and an authorized storage destination instead of allowing remote presentation metadata to select existing private files.
Test dual names and decoding failures
Use harmless response fixtures with both parameter forms, a non-ASCII extended value, a quoted fallback and malformed encoding. Add distinct labels that map to the same sanitized storage name. Acceptance requires the chosen visible label to follow the supported parsing contract while each document keeps its independent artifact association. Observe extracted-text and evidence links, not just the download dialog. No browser download, document import or filesystem allocation was executed here.
Keep identity evidence beyond the display name
Storage version identities identify selected objects independently of a friendly name. Stack reproducibility preserves the client and parser used to interpret the response. A correctly displayed filename establishes neither trustworthy content nor current document permission. Retain the association that lets a reviewer trace an AI answer to the accepted bytes, even if another locale or client presents a different label for them.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.