Esempio n. 1
0
        public async Task <IActionResult> PrintErrorLoadTask(List <ListBranchExcelModel> response)
        {
            string sWebRootFolder = _Env.ContentRootPath;
            var    log            = DateTime.Now;
            string LogFile        = log.ToString("yyyyMMddHHmmss");
            string sFileName      = @"Ruta4.xlsx";
            string URL            = string.Format("{0}://{1}/{2}", Request.Scheme, Request.Host, sFileName);

            FileInfo file = new FileInfo(Path.Combine(sWebRootFolder, sFileName));

            if (file.Exists)
            {
                file.Delete();
                file = new FileInfo(Path.Combine(sWebRootFolder, sFileName));
            }
            else
            {
                file = new FileInfo(Path.Combine(sWebRootFolder, sFileName));
            }
            var reply = _taskCampaignBusiness.PrintErrorTask(response, file);

            var streams = new MemoryStream(System.IO.File.ReadAllBytes(Path.Combine(sWebRootFolder, sFileName)));

            reply.data = _taskCampaignBusiness.GetUrlAzureContainerbyStrem(streams, LogFile, ".xlsx");

            return(Ok(reply));
        }