public async Task <HttpResponseMessage> Post() { if (!Request.Content.IsMimeMultipartContent()) { throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType); } string _filePath = WebSettings.FILE_REPO(); var _physicalPath = HttpContext.Current.Server.MapPath(_filePath); Directory.CreateDirectory(_physicalPath); var _provider = new FilenameMultipartFormDataStreamProvider(_physicalPath); var _result = await Request.Content.ReadAsMultipartAsync(_provider); return(Request.CreateResponse(HttpStatusCode.OK, "success!")); }