public async Task <IHttpActionResult> UploadVersion(Guid guidId) { var file = HttpContext.Current.Request.Files.Count > 0 ? HttpContext.Current.Request.Files[0] : null; if (file != null && file.ContentLength > 0) { var fileName = Guid.NewGuid().ToString(); var path = Path.Combine(HttpContext.Current.Server.MapPath("~/App_data"), fileName); file.SaveAs(path); var version = _fileService.ChangeVersion(guidId, fileName, file.ContentType, path, file.ContentLength); return(Ok()); } throw new HttpResponseException(HttpStatusCode.BadRequest); }