Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public async Task<JsonResult> Create()
if (!Request.Content.IsMimeMultipartContent())
return Error(HttpStatusCode.UnsupportedMediaType,
"Mime type must be multipart");
var root = _hostingEnvironmentPathMapper.GetMappedPath("~/App_Data");
var provider = new MultipartFormDataStreamProvider(root);
await Request.Content.ReadAsMultipartAsync(provider);
// Read multipart form data from the provider and
// do awesome things with it.
// Woes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.