예제 #1
0
        private async Task WriteCopyOfMergedDocumentToBlob(string mergedFileName, Document document)
        {
            var memoryStream = new MemoryStream();

            document.SaveToStream(memoryStream, FileFormat.Docx);

            memoryStream.Position = 0;

            var containerName = "mergeddocuments";
            var container     = await _initialiseContainer.GetContainer(containerName);

            var blob = container.GetBlockBlobReference(mergedFileName);

            blob.UploadFromStream(memoryStream);

            memoryStream.Position = 0;
            //await _fileTransferClient.Send(memoryStream, mergedFileName);
        }
        private async Task WriteCopyOfMergedDocumentToBlob(string mergedFileName, MemoryStream memoryStream)
        {
            memoryStream.Position = 0;

            var containerName = "mergeddocuments";
            var container     = await _initialiseContainer.GetContainer(containerName);

            var blob = container.GetBlockBlobReference(mergedFileName);

            blob.UploadFromStream(memoryStream);

            memoryStream.Position = 0;
        }
        public async Task <MemoryStream> Get()
        {
            var containerName = "printfunctionflow";

            var container = await _initialiseContainer.GetContainer(containerName);

            var blob         = container.GetBlockBlobReference(TemplateFile);
            var memoryStream = new MemoryStream();

            blob.DownloadToStream(memoryStream);

            _aggregateLogger.LogInfo($"Downloaded memory stream length = {blob.Properties.Length}");

            return(memoryStream);
        }