public IHttpActionResult Post(UploadFileInfo fi) { string dir = HttpContext.Current.Server.MapPath("~/Upload"); using(FileStream fileStream = new FileStream( Path.Combine(dir, fi.FileName), FileMode.OpenOrCreate, FileAccess.Write)) { fileStream.Write(fi.FileContent, 0, fi.FileContent.Length); } return Ok(dir); }