Esempio n. 1
0
        public object GetFile(int FileId)
        {
            var file     = SampleFileBiz.GetFile(FileId);
            var response = Request.CreateResponse();

            response.Content = new ByteArrayContent(file.Content);
            response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
            {
                FileName = file.Name
            };
            response.Content.Headers.ContentType = new MediaTypeHeaderValue(file.Type);

            return(response);
        }
Esempio n. 2
0
 public object PostFile(object json)
 {
     return(SampleFileBiz.PostFile(json, HttpContext.Current.Request.Files[0]));
 }