public HttpResponseMessage Get(string id) { if (String.IsNullOrEmpty(id)) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } else { id = _browserService.DecodeString(id); HttpResponseMessage response = new HttpResponseMessage(); response.Content = _browserService.GetContent(id); if (id.EndsWith("pdf")) { response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/pdf"); } if (id.EndsWith("doc")) { response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/msword"); response.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("inline"); } return(response); } }
public IHttpActionResult Get(string id) { string decodedInput = _browserService.DecodeString(id); dirinfo = _browserService.ReturnFilesDirs(decodedInput); return(Ok(dirinfo)); }
public IHttpActionResult Get(string id) { List <int> countedFiles = new List <int>(); string decodedInput = _browserService.DecodeString(id); countedFiles = _browserService.Countfiles(decodedInput); return(Ok(countedFiles)); }