Skip to content

[Storage] Update Get-AzStorageFileContent download offset and content length calc logic #24600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Storage/Storage.Management/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/Storage/Storage/File/Cmdlet/GetAzureStorageFileContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down