예제 #1
0
        public FileResult download(int?FieldViewId)
        {
            FileProperties fileProperties = publicationService.GetFileInformationById(FieldViewId);
            string         fileName       = fileProperties.FileName;
            string         filePath       = fileProperties.FilePath;
            string         fileText       = System.IO.File.ReadAllText(filePath);
            string         contentType;

            new FileExtensionContentTypeProvider().TryGetContentType(filePath, out contentType);
            FileResult fr = File(Encoding.UTF8.GetBytes(fileText), "application/pdf", fileName);

            return(fr);
        }