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); }
public object PostFile(object json) { return(SampleFileBiz.PostFile(json, HttpContext.Current.Request.Files[0])); }