HttpContentDispositionHeaderValue HttpContentDispositionHeaderValue HttpContentDispositionHeaderValue HttpContentDispositionHeaderValue 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// You can use this class in JavaScript.
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) HttpContentDispositionHeaderValue(String)

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

public : HttpContentDispositionHeaderValue(PlatForm::String dispositionType)public HttpContentDispositionHeaderValue(String dispositionType)Public Sub New(dispositionType As String)// You can use this method in JavaScript.
Parameters
dispositionType
PlatForm::String String String String

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

Properties

DispositionType DispositionType DispositionType DispositionType

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

public : PlatForm::String DispositionType { get; set; }public string DispositionType { get; set; }Public ReadWrite Property DispositionType As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

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

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 FileName

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

public : PlatForm::String FileName { get; set; }public string FileName { get; set; }Public ReadWrite Property FileName As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A suggested filename.

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 FileNameStar

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

public : PlatForm::String FileNameStar { get; set; }public string FileNameStar { get; set; }Public ReadWrite Property FileNameStar As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

A suggested filename of the form filename*.

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 Name

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

public : PlatForm::String Name { get; set; }public string Name { get; set; }Public ReadWrite Property Name As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The name for the content body part.

Parameters Parameters Parameters Parameters

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

public : IVector<HttpNameValueHeaderValue> Parameters { get; }public IList<HttpNameValueHeaderValue> Parameters { get; }Public ReadOnly Property Parameters As IList<HttpNameValueHeaderValue>// You can use this property in JavaScript.
Value
IVector<HttpNameValueHeaderValue> IList<HttpNameValueHeaderValue> IList<HttpNameValueHeaderValue> IList<HttpNameValueHeaderValue>

A set of parameters.

Size 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 Nullable<ulong> Size { get; set; }Public ReadWrite Property Size As Nullable<ulong>// You can use this property in JavaScript.
Value
IReference<ulong> Nullable<ulong> Nullable<ulong> Nullable<ulong>

The approximate size, in bytes.

Methods

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

Converts a string to an HttpContentDispositionHeaderValue instance.

public : static HttpContentDispositionHeaderValue Parse(PlatForm::String input)public static HttpContentDispositionHeaderValue Parse(String input)Public Static Function Parse(input As String) As HttpContentDispositionHeaderValue// You can use this method in JavaScript.
Parameters
input
PlatForm::String String String String

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

Returns

Remarks

Below are the exceptions that this function throws.

E_INVALIDARG

The input parameter is null (Nothing in Visual Basic).

The input parameter is not valid content disposition information.

ToString() ToString() ToString() ToString()

Returns a string that represents the current HttpContentDispositionHeaderValue object.

public : PlatForm::String ToString()public string ToString()Public Function ToString() As string// You can use this method in JavaScript.
Returns
PlatForm::String string string string

A string that represents the current object.

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

Determines whether a string is valid HttpContentDispositionHeaderValue information.

public : static PlatForm::Boolean TryParse(PlatForm::String input, HttpContentDispositionHeaderValue contentDispositionHeaderValue)public static bool TryParse(String input, HttpContentDispositionHeaderValue contentDispositionHeaderValue)Public Static Function TryParse(input As String, contentDispositionHeaderValue As HttpContentDispositionHeaderValue) As bool// You can use this method in JavaScript.
Parameters
input
PlatForm::String String String String

The string to validate.

Returns
PlatForm::Boolean bool bool bool

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