Testing out Web API for file uploading, have a simple view model like this:
public class TestModel {
public string UserId {get;set;}
public HttpPoste
You can either write a custom MediaTypeFormatter
to facilitate your scenario or you can pull the data out of the request by hand using MultipartFormDataStreamProvider.FormData.AllKeys
collection. This way you can post both the file(s) and additional fields in one request.
A good tutorial by Mike Wasson is available here: http://www.asp.net/web-api/overview/working-with-http/sending-html-form-data,-part-2