diff --git a/src/Storage/Storage.Management/ChangeLog.md b/src/Storage/Storage.Management/ChangeLog.md index 02e58dc4689d..5bfcd4936872 100644 --- a/src/Storage/Storage.Management/ChangeLog.md +++ b/src/Storage/Storage.Management/ChangeLog.md @@ -19,6 +19,8 @@ --> ## Upcoming Release * Fixed object replication policy time format parsing issue [#24434] +* Updated download offset and content length calculation logic for downloading files + - `Get-AzStorageFileContent` ## Version 6.1.3 * Introduced secrets detection feature to safeguard sensitive data. diff --git a/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs b/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs index 1424ef53bf12..f6bb08110be8 100644 --- a/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs +++ b/src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs @@ -340,8 +340,8 @@ await DataMovementTransferHelper.DoTransfer(() => downloadOptions.Range = new HttpRange(downloadOffset, contentSize); ShareFileDownloadInfo download = fileClientToBeDownloaded.Download(downloadOptions, cancellationToken: this.CmdletCancellationToken); download.Content.CopyTo(stream); - downloadOffset += contentSize; - contentLenLeft -= contentSize; + downloadOffset += download.ContentLength; + contentLenLeft -= download.ContentLength; progressHandler.Report(downloadOffset); } }