Skip to content

Commit

Permalink
WA for Azure SDK bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ggallotti committed Nov 10, 2021
1 parent d1c88eb commit 2fd8f01
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,20 @@ public string Upload(string fileName, Stream stream, GxFileType fileType)
{
blob.Properties.ContentType = mimeType;
}

blob.UploadFromStreamAsync(stream).GetAwaiter().GetResult();

using (MemoryStream ms = new MemoryStream())
{
/*
* WA for Issue Azure SDK:
https://github.com/Azure/azure-sdk-for-net/issues/10814
https://github.com/Azure/azure-storage-net-data-movement/issues/148
https://github.com/Azure/azure-storage-net/issues/864
* */
stream.Position = 0;
stream.CopyTo(ms);
ms.Position = 0;
blob.UploadFromStreamAsync(ms).GetAwaiter().GetResult();
}
return GetURL(blob, fileType);
}

Expand Down

0 comments on commit 2fd8f01

Please sign in to comment.