示例#1
0
        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);
            }
        }
示例#2
0
        public IHttpActionResult Get(string id)
        {
            string decodedInput = _browserService.DecodeString(id);

            dirinfo = _browserService.ReturnFilesDirs(decodedInput);
            return(Ok(dirinfo));
        }
示例#3
0
        public IHttpActionResult Get(string id)
        {
            List <int> countedFiles = new List <int>();
            string     decodedInput = _browserService.DecodeString(id);

            countedFiles = _browserService.Countfiles(decodedInput);
            return(Ok(countedFiles));
        }