I have an ASP.Net Web API application that allows clients (html pages and iPhone apps) to upload images to. I am using an async upload task as described in this article.
Since @KiranChalla posted their answer, a new abstract class MultipartFormDataRemoteStreamProvider was introduced in Fix 1760: Make MultipartFormDataStreamProvider easier to work with non-FileStreams. to make this easier.
The summary of the class does a good job at explaining how to use it:
A
MultipartStreamProviderimplementation suited for use with HTML file uploads for writing file content to a remote storageStream. The stream provider looks at the Content-Disposition header field and determines an output remoteStreambased on the presence of a filename parameter. If a filename parameter is present in the Content-Disposition header field, then the body part is written to a remoteStreamprovided byGetRemoteStream. Otherwise it is written to aMemoryStream.