Exemplo n.º 1
0
        public IActionResult DownloadAllLogsFiles()
        {
            var response = _logsService.GetAllLogsFilesBytes();

            if (response.StatusCode == HttpStatusCode.OK)
            {
                string zipName  = $"Logs_{DateTime.Now:yyyy-MM-dd-HHmmss}.zip";
                string mimeType = "application/zip";

                return(new FileContentResult(response.Payload, mimeType)
                {
                    FileDownloadName = zipName
                });
            }
            return(SendResponse(response));
        }