content_disposition_header
Construct a Content-Disposition HTTP header value from the given filename as specified by RFC 6266.
def content_disposition_header(
as_attachment: boolean,
filename: string
) - > string
Construct a Content-Disposition HTTP header value from the given filename as specified by RFC 6266.
Parameters
| Name | Type | Description |
|---|---|---|
| as_attachment | boolean | A flag indicating whether the content should be treated as an attachment (download) or displayed inline. |
| filename | string | The name of the file to be suggested in the header, which will be encoded according to RFC standards based on its character set. |
Returns
| Type | Description |
|---|---|
string | The formatted Content-Disposition header value, or None if no filename is provided and it is not an attachment. |