Skip to content

basalt / http/src / contentDisposition

Function: contentDisposition() ​

> contentDisposition(filename, disposition?): string

Defined in: http/src/stream.ts:112

A Content-Disposition value for a client-supplied filename: the name goes through sanitizeFilename (no directories, control characters or bidi overrides), the plain filename= parameter keeps only printable ASCII with quotes and backslashes replaced, and anything lost that way is carried by an RFC 5987 filename*=UTF-8''… parameter.

Parameters ​

filename ​

string

disposition? ​

"inline" | "attachment"

Returns ​

string

Released under the MIT License.