Skip to content

Commit 61630f5

Browse files
committed
fix getblobcontent issue when length is -1
1 parent c0b5802 commit 61630f5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Storage/Storage/Blob/Cmdlet/CopyAzureStorageBlob.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ private void CopyBlobSync(IStorageBlobManagement destChannel, string srcUri, str
321321
private async Task CopyFromUri(long taskId, IStorageBlobManagement destChannel, Uri srcUri, BlobBaseClient destBlob)
322322
{
323323
bool destExist = true;
324-
//Track2Models.BlobType? destBlobType = Util.GetBlobType(destBlob);
325324
Track2Models.BlobType? srcBlobType = Util.GetBlobType(new BlobBaseClient(srcUri, ClientOptions), true).Value;
326325
Track2Models.BlobType? destBlobType = Util.GetBlobType(new BlobBaseClient(srcUri, ClientOptions), true).Value;
327326
Track2Models.BlobProperties properties = null;

src/Storage/Storage/Blob/Cmdlet/GetAzureStorageBlobContent.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ internal virtual async Task DownloadBlob(long taskId, IStorageBlobManagement loc
150150
string activity = String.Format(Resources.ReceiveAzureBlobActivity, blob.Name, filePath);
151151
string status = Resources.PrepareDownloadingBlob;
152152
ProgressRecord pr = new ProgressRecord(OutputStream.GetProgressId(taskId), activity, status);
153+
154+
// Get the length information if the blob doesn't have it
155+
if (blob.Properties.Length < 0)
156+
{
157+
blob.FetchAttributes();
158+
}
159+
153160
DataMovementUserData data = new DataMovementUserData()
154161
{
155162
Data = blob,

0 commit comments

Comments
 (0)