MimeContentDisposition Class

The value of a Content-Disposition header ([RFC 2183]): inline or attachment, and parameters such as the file name.

public sealed class MimeContentDisposition

Constructors

NameDescription
MimeContentDisposition(string)Initializes a new instance of the MimeContentDisposition class.

MimeContentDisposition(string)

MimeContentDisposition.cs

Initializes a new instance of the MimeContentDisposition class.

public MimeContentDisposition(string disposition)

Parameters

disposition string
The disposition, such as MimeContentDisposition.Attachment.

Properties

NameDescription
DispositionGets or sets the disposition, such as inline or attachment.
FileNameGets or sets the file name.
IsAttachmentGets whether the disposition is attachment.
ParametersGets the parameters, with case-insensitive names.

Gets or sets the disposition, such as inline or attachment.

public string Disposition { get; set; }

Property value

string

Gets or sets the file name.

public string? FileName { get; set; }

Property value

string?

Gets whether the disposition is attachment.

public bool IsAttachment { get; }

Property value

bool

Gets the parameters, with case-insensitive names.

public IDictionary<string, string> Parameters { get; }

Methods

NameDescription
Parse(string)Parses the value of a Content-Disposition header.
ToString()Returns the value of the header.

Parses the value of a Content-Disposition header.

public static MimeContentDisposition Parse(string value)

Parameters

value string
The value of the header.

Returns

MimeContentDisposition The disposition.

Returns the value of the header.

public override string ToString()

Returns

string The value of the header.

Constants

NameDescription
AttachmentThe disposition of a part the user saves or opens.
InlineThe disposition of a part shown in the body of the message.

Attachment

The disposition of a part the user saves or opens.

public const string Attachment = "attachment"

Inline

The disposition of a part shown in the body of the message.

public const string Inline = "inline"