예제 #1
0
        public IActionResult ViewFile(Guid id)
        {
            var record   = _resourceRepository.GetByIdAsync(id).Result;
            var fileInfo = _resourceRepository.DownloadFile(record.FileId);
            var fileName = fileInfo.FileInfo.Filename;
            var minetype = FileContentType.GetMimeType(Path.GetExtension(fileName));

            return(File(fileInfo, minetype, fileName));
        }