Skip to content

Commit e220a68

Browse files
yifanz7Nickcandy
andauthored
[Storage] Update Get-AzStorageFileContent download offset and content length calc logic (#24600)
* Update offset logic * Update ChangeLog.md --------- Co-authored-by: NanxiangLiu <33285578+Nickcandy@users.noreply.github.com>
1 parent 22f8c20 commit e220a68

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Storage/Storage.Management/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
-->
2020
## Upcoming Release
2121
* Fixed object replication policy time format parsing issue [#24434]
22+
* Updated download offset and content length calculation logic for downloading files
23+
- `Get-AzStorageFileContent`
2224

2325
## Version 6.1.3
2426
* Introduced secrets detection feature to safeguard sensitive data.

src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ await DataMovementTransferHelper.DoTransfer(() =>
340340
downloadOptions.Range = new HttpRange(downloadOffset, contentSize);
341341
ShareFileDownloadInfo download = fileClientToBeDownloaded.Download(downloadOptions, cancellationToken: this.CmdletCancellationToken);
342342
download.Content.CopyTo(stream);
343-
downloadOffset += contentSize;
344-
contentLenLeft -= contentSize;
343+
downloadOffset += download.ContentLength;
344+
contentLenLeft -= download.ContentLength;
345345
progressHandler.Report(downloadOffset);
346346
}
347347
}

0 commit comments

Comments
 (0)