Recently we were faced with a unique challenge. One of our mobile apps was posting images to our WebAPI. The WebAPI in question was written for an older MVC application. For the Mobile App, the problem was the function was not able to use HttpPostedFileBase class.
Obviously, the client application, in this case, a Xamarin application was using HttpClient and Multipart/Form-Data to post image file(s) to our WebAPI. This is the solution that we came up with. It was later modified for multiple files.
Please be aware that this example isn't a complete code but part of our solution, hence after receiving the image file the code just returns a base64 string
In the code above it is my assumption that there will be only one file posted hence I return the "answer" variables value. In a real world scenario, any code which operates on a file like saving, uploading etc to other application needs to be written inside the loop and should run for each file in the provider.FileData collection.