Exemple #1
0
        public async Task <IActionResult> GetNewestPolicy()
        {
            var policyFileName = _configuration["FileConfig:HolidayPolicyFileName"];
            var downloadInfo   = await _azureStorageService.GetBlobDownloadInfo("policy", policyFileName);

            return(File(downloadInfo.Content, downloadInfo.ContentType, policyFileName));
        }
Exemple #2
0
        public async Task <IActionResult> GetFile(string fileGuid)
        {
            var file = await _fileService.GetByGuid(fileGuid);

            if (file is null)
            {
                return(BadRequest());
            }

            var containerName = _fileService.GetBlobContainerName(file.Type);
            var downloadInfo  = await _azureStorageService.GetBlobDownloadInfo(containerName, file.Name);

            return(File(downloadInfo.Content, downloadInfo.ContentType, file.Name));
        }