<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="4.0.20505" />

MultipartFormDataStreamProvider

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.
public IDictionary<string, string> BodyPartFileNames { get; }

Gets an <see cref="T:System.Collections.Generic.IDictionary`2" /> instance containing mappings of each <b>filename</b> parameter provided in a <b>Content-Disposition</b> header field (represented as the keys) to a local file name where the contents of the body part is stored (represented as the values).

public MultipartFormDataStreamProvider(string rootPath)

Initializes a new instance of the MultipartFormDataStreamProvider class.

public MultipartFormDataStreamProvider(string rootPath, int bufferSize)

Initializes a new instance of the MultipartFormDataStreamProvider class.

public virtual string GetLocalFileName(HttpContentHeaders headers)

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.

public virtual Stream GetStream(HttpContentHeaders headers)

This body part stream provider examines the headers provided by the MIME multipart parser and decides whether it should return a file stream or a memory stream for the body part to be written to.