I use the MultipartFormDataStreamProvider to read uploaded files as the snippet below illustrates. However this isn't secure as it saves the files straight to temp. First, I want to inspect the raw bytes and perform some validation checks. Please show me how to access the raw bytes.
if (Request.Content.IsMimeMultipartContent())
{
MultipartFormDataStreamProvider streamProvider = new MultipartFormDataStreamProvider("C:\temp");
return this.Request.Content
.ReadAsMultipartAsync<MultipartFormDataStreamProvider>(streamProvider)
.ContinueWith((tsk) =>
{
MultipartFormDataStreamProvider provider = tsk.Result;
});
}