public IHttpActionResult upload() { HttpRequest request = HttpContext.Current.Request; CVConverterLogic logic = new CVConverterLogic(); if (request.Files.Count > 1) { return(Content(System.Net.HttpStatusCode.BadRequest, "One File Allowed")); } else { logic.saveFile(request.Files[0]); return(Ok(request.Files)); } }
public HttpResponseMessage upload() { HttpRequest request = HttpContext.Current.Request; CVConverterLogic logic = new CVConverterLogic(); if (request.Files.Count != 1) { return(Request.CreateErrorResponse(System.Net.HttpStatusCode.BadRequest, "One File Allowed")); } else { logic.saveFile(request.Files[0]); return(Request.CreateResponse(HttpStatusCode.OK, request.Files)); } }