Notifications
Announcements
No record found.
public void createData() { CommaStreamIo io = CommaStreamIo::constructForWrite(); CustTable custTable; const str fileName = "customers.log"; str folderName = "\local\iftablepurgelogs" io.writeExp(['Account Number', 'Customer' , 'Currency', 'Data Area']); while select custTable where custTable.DataAreaId == 'USMF' { io.writeExp([custTable.AccountNum, custTable.name(), custTable.Currency, custTable.DataAreaId]); } System.IO.Stream stream = iO.getStream(); }
private void UploadToBlobStorage(Stream stream, string fileName, string folderName) { string connectionString = "your_connection_string"; // Replace with your Azure Blob Storage connection string string containerName = "your_container_name"; // Replace with your container name BlobServiceClient blobServiceClient = new BlobServiceClient(connectionString); BlobContainerClient containerClient = blobServiceClient.GetBlobContainerClient(containerName); // Combine folder name and file name to create the blob name string blobName = $"{folderName}/{fileName}"; BlobClient blobClient = containerClient.GetBlobClient(blobName); // Upload the stream to the blob blobClient.Upload(stream, new BlobHttpHeaders { ContentType = "text/plain" }); Console.WriteLine($"File uploaded to Blob Storage: {blobName}"); }
System.Exception ex; try { Microsoft.WindowsAzure.Storage.Auth.StorageCredentials storageCredentials = new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials("StorageAccountName", "StorageKey"); Microsoft.WindowsAzure.Storage.CloudStorageAccount storageAccount = new Microsoft.WindowsAzure.Storage.CloudStorageAccount(storageCredentials, true); var blobcli = storageAccount.CreateCloudBlobClient(); Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer cont = blobcli.GetContainerReference("Container"); stream.Position = 0; Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob cloudBlockBlob = cont.GetBlockBlobReference("fileName"); cloudBlockBlob.UploadFromStream(stream,null,null,null); } catch(ex) { throw error(strFmt("UploadFailed", ex.Message)); }
** Please don't forget to close up the thread here by Like and verify it as an answer if it was solved **
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 467 Super User 2025 Season 2
Martin Dráb 420 Most Valuable Professional
BillurSamdancioglu 241 Most Valuable Professional