Esempio n. 1
0
        public FileResult DownloadDoc(int Id, int CaseheaderId)
        {
            SupportingDocs supportdoc = CMSService.DownloadDocument(Id);

            string folderName = System.Configuration.ConfigurationManager.AppSettings["_SupportDocuments"] + CaseheaderId + '\\' + codeTable.ListOfFolders.Where(f => f.Id == supportdoc.FolderTypeId).FirstOrDefault().Description.Replace(" ", "");

            var fileSavePath = Path.Combine(folderName, supportdoc.FileName);

            byte[] fileBytes = System.IO.File.ReadAllBytes(fileSavePath);

            return(File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, supportdoc.FileName));
        }