HttpContentDispositionHeaderValue HttpContentDispositionHeaderValue HttpContentDispositionHeaderValue HttpContentDispositionHeaderValue Class

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

Syntax

Declaration

public sealed class HttpContentDispositionHeaderValuepublic sealed class HttpContentDispositionHeaderValuePublic NotInheritable Class HttpContentDispositionHeaderValue

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 summary

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

Properties summary

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

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

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

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

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

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

Methods summary

Converts a string to an HttpContentDispositionHeaderValue instance.

Returns a string that represents the current HttpContentDispositionHeaderValue object.

Determines whether a string is valid HttpContentDispositionHeaderValue information.

Constructors

  • HttpContentDispositionHeaderValue(System.String)
    HttpContentDispositionHeaderValue(System.String)
    HttpContentDispositionHeaderValue(System.String)
    HttpContentDispositionHeaderValue(System.String)

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

    public HttpContentDispositionHeaderValue(System.String dispositionType)public HttpContentDispositionHeaderValue(System.String dispositionType)Public Function HttpContentDispositionHeaderValue(dispositionType As System.String) As

    Parameters

    • dispositionType
      System.String
      System.String
      System.String
      System.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 string DispositionType { get; set; }public string DispositionType { get; set; }Public ReadWrite Property DispositionType As string

    Property Value

    • 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 string FileName { get; set; }public string FileName { get; set; }Public ReadWrite Property FileName As string

    Property Value

    • 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 string FileNameStar { get; set; }public string FileNameStar { get; set; }Public ReadWrite Property FileNameStar As string

    Property Value

    • 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 string Name { get; set; }public string Name { get; set; }Public ReadWrite Property Name As string

    Property Value

    • 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 IVector<HttpNameValueHeaderValue> Parameters { get; }Public ReadOnly Property Parameters As IVector<HttpNameValueHeaderValue>

    Property Value

    • 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 IReference<ulong> Size { get; set; }Public ReadWrite Property Size As IReference<ulong>

    Property Value

    • The approximate size, in bytes.

Methods

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ActivatableAttribute

Details

Assembly

Windows.Web.Http.Headers.dll