Share via


MultipartFormDataStreamProvider Class

An IMultipartStreamProvider suited for use with HTML file uploads for writing file content to a FileStream. The stream provider looks at the <b>Content-Disposition</b> header field and determines an output Stream based on the presence of a <b>filename</b> parameter. If a <b>filename</b> parameter is present in the <b>Content-Disposition</b> header field then the body part is written to a FileStream, otherwise it is written to a MemoryStream. This makes it convenient to process MIME Multipart HTML Form data which is a combination of form data and file content.

Inheritance Hierarchy

System.Object
  System.Net.Http.MultipartStreamProvider
    System.Net.Http.MultipartFileStreamProvider
      System.Net.Http.MultipartFormDataStreamProvider

Namespace:  System.Net.Http
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

Syntax

'Declaration
Public Class MultipartFormDataStreamProvider _
    Inherits MultipartFileStreamProvider
'Usage
Dim instance As MultipartFormDataStreamProvider
public class MultipartFormDataStreamProvider : MultipartFileStreamProvider
public ref class MultipartFormDataStreamProvider : public MultipartFileStreamProvider
type MultipartFormDataStreamProvider =  
    class
        inherit MultipartFileStreamProvider
    end
public class MultipartFormDataStreamProvider extends MultipartFileStreamProvider

The MultipartFormDataStreamProvider type exposes the following members.

Constructors

  Name Description
Public method MultipartFormDataStreamProvider(String) Initializes a new instance of the MultipartFormDataStreamProvider class.
Public method MultipartFormDataStreamProvider(String, Int32) Initializes a new instance of the MultipartFormDataStreamProvider class.

Top

Properties

  Name Description
Protected property BufferSize Gets or sets the number of bytes buffered for writes to the file. (Inherited from MultipartFileStreamProvider.)
Public property Contents Gets or sets the contents for this MultipartStreamProvider. (Inherited from MultipartStreamProvider.)
Public property FileData Gets or sets the multipart file data. (Inherited from MultipartFileStreamProvider.)
Public property FormData Gets a NameValueCollection of form data passed as part of the multipart form data.
Protected property RootPath Gets or sets the root path where the content of MIME multipart body parts are written to. (Inherited from MultipartFileStreamProvider.)

Top

Methods

  Name Description
Public method Equals (Inherited from Object.)
Public method ExecutePostProcessingAsync Reads the non-file contents as form data (Overrides MultipartStreamProvider.ExecutePostProcessingAsync().)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetLocalFileName Gets the name of the local file which will be combined with the root path to create an absolute file name where the contents of the current MIME body part will be stored. (Inherited from MultipartFileStreamProvider.)
Public method GetStream (Overrides MultipartFileStreamProvider.GetStream(HttpContent, HttpContentHeaders).)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Net.Http Namespace