Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Upload to Blob storage
- ```
- BlobClient versionBlobClient = GetBlobContainerClient().GetBlobClient(itemVersionBlobName);
- versionBlobClient.Upload(itemBlobStream);
- ```
- Upload to S3
- ```
- await transferUtility.UploadAsync(new TransferUtilityUploadRequest
- {
- BucketName = bucketName,
- Key = blobName,
- InputStream = stream
- });
- ```
- Download from Blob storage
- ```
- itemWrapper.DownloadInfo = new Core.DownloadInfo
- {
- Content = await S3StorageLibrary.Utilities.GetContent(transferUtility, bucketName, itemContentBlobName, Key),
- ContentLength = await S3StorageLibrary.Utilities.GetContentLength(S3Client, bucketName, itemContentBlobName, Key)
- };
- ```
- Download from S3
- ```
- string itemContentBlobName = Utilities.GetDriveItemContentBlobName(itemBlobName);
- Azure.Storage.Blobs.BlobClient itemBlobContentClient =
- GetBlobContainerClient().GetBlobClient(itemContentBlobName);
- if (itemBlobContentClient.Exists())
- {
- var contentBlobDownload = itemBlobContentClient.Download().Value;
- itemWrapper.DownloadInfo = new Core.DownloadInfo
- {
- Content = contentBlobDownload.Content,
- ContentLength = contentBlobDownload.ContentLength
- };
- }
- ```
- Content is an object of type Stream
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement