Http​Content​Disposition​Header​Value Http​Content​Disposition​Header​Value Http​Content​Disposition​Header​Value Class

Definition

Represents the value of the Content-Disposition HTTP header on HTTP content in a request or a response.

public sealed class HttpContentDispositionHeaderValue : IStringable, IHttpContentDispositionHeaderValuepublic sealed class HttpContentDispositionHeaderValue : IStringable, IHttpContentDispositionHeaderValuePublic NotInheritable Class HttpContentDispositionHeaderValue Implements IStringable, IHttpContentDispositionHeaderValue
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The HttpContentDispositionHeaderValue class represents information in the Content-Disposition header on HTTP content sent in an HTTP request or received in an HTTP response.

The ContentDisposition property on the HttpContentHeaderCollection returns an HttpContentDispositionHeaderValue.

The Content-Disposition header is normally used for working with file uploads and downloads. The format differs from other headers in that it is a single header with a disposition type followed by a list of parameters, some of which are well defined.

This header is used in two different contexts:

Constructors

HttpContentDispositionHeaderValue(String) HttpContentDispositionHeaderValue(String) HttpContentDispositionHeaderValue(String)

Initializes a new instance of the HttpContentDispositionHeaderValue class with content-coding information for use in the Content-Disposition HTTP header.

public HttpContentDispositionHeaderValue(String dispositionType)public HttpContentDispositionHeaderValue(String dispositionType)Public Sub New(dispositionType As String)
Parameters
dispositionType
System.String System.String System.String

The value of the disposition-type information to be used in the Content-Disposition HTTP header.

Attributes

Properties

DispositionType DispositionType DispositionType

Gets or sets the value of the disposition-type information in the Content-Disposition HTTP header.

public string DispositionType { get; set; }public string DispositionType { get; set; }Public ReadWrite Property DispositionType As string
Value
string string string

The value of the disposition-type characteristic in the Content-Disposition HTTP header.

Attributes

Remarks

The DispositionType property represents the disposition type for a content body part.

A body part should be marked with a DispositionType property of "inline" if it is intended to be displayed automatically upon display of the message. A body part can be designated with a DispositionType property of "attachment" to indicate that they are separate from the main body of the HTTP request or response.

FileName FileName FileName

Gets or sets the value of the filename-parm information in the Content-Disposition HTTP header for a single file.

public string FileName { get; set; }public string FileName { get; set; }Public ReadWrite Property FileName As string
Value
string string string

A suggested filename.

Attributes

Remarks

The FileName property is a suggestion for how to construct a filename for storing the message payload to be used if the entity is detached and stored in a separate file.

The FileName property uses MIME encoding for non-ascii characters.

FileNameStar FileNameStar FileNameStar

Gets or sets the value of the filename-parm characteristic in the Content-Disposition HTTP header for multiple files.

public string FileNameStar { get; set; }public string FileNameStar { get; set; }Public ReadWrite Property FileNameStar As string
Value
string string string

A suggested filename of the form filename*.

Attributes

Remarks

The FileNameStar property is a suggestion for how to construct filenames for storing message payloads to be used if the entities are detached and stored in a separate files.

Name Name Name

Gets or sets the name for a content body part in the Content-Disposition HTTP header.

public string Name { get; set; }public string Name { get; set; }Public ReadWrite Property Name As string
Value
string string string

The name for the content body part.

Attributes

Parameters Parameters Parameters

Gets a set of parameters included in the Content-Disposition HTTP header.

public IVector<HttpNameValueHeaderValue> Parameters { get; }public IVector<HttpNameValueHeaderValue> Parameters { get; }Public ReadOnly Property Parameters As IVector<HttpNameValueHeaderValue>
Value

A set of parameters.

Attributes

Size Size Size

Gets or sets the approximate size, in bytes, of the file used in the Content-Disposition HTTP header.

public IReference<ulong> Size { get; set; }public IReference<ulong> Size { get; set; }Public ReadWrite Property Size As IReference<ulong>
Value

The approximate size, in bytes.

Attributes

Methods

Parse(String) Parse(String) Parse(String)

Converts a string to an HttpContentDispositionHeaderValue instance.

public static HttpContentDispositionHeaderValue Parse(String input)public static HttpContentDispositionHeaderValue Parse(String input)Public Static Function Parse(input As String) As HttpContentDispositionHeaderValue
Parameters
input
System.String System.String System.String

A string that represents the content disposition information in the Content-Disposition HTTP header.

Returns
Attributes

ToString() ToString() ToString()

Returns a string that represents the current HttpContentDispositionHeaderValue object.

public string ToString()public string ToString()Public Function ToString() As string
Returns
string string string

A string that represents the current object.

Attributes

TryParse(String, HttpContentDispositionHeaderValue) TryParse(String, HttpContentDispositionHeaderValue) TryParse(String, HttpContentDispositionHeaderValue)

Determines whether a string is valid HttpContentDispositionHeaderValue information.

public static bool TryParse(String input, HttpContentDispositionHeaderValue contentDispositionHeaderValue)public static bool TryParse(String input, HttpContentDispositionHeaderValue contentDispositionHeaderValue)Public Static Function TryParse(input As String, contentDispositionHeaderValue As HttpContentDispositionHeaderValue) As bool
Parameters
input
System.String System.String System.String

The string to validate.

Returns
bool bool bool

true if input is valid HttpContentDispositionHeaderValue information; otherwise, false.

Attributes