mirror of
https://github.com/bitwarden/server
synced 2025-12-14 07:13:39 +00:00
MultiplartSectionBody streams have 0 length until read. (#1196)
This commit is contained in:
@@ -222,10 +222,11 @@ namespace Bit.Core.Services
|
|||||||
AttachmentId = attachmentId,
|
AttachmentId = attachmentId,
|
||||||
FileName = fileName,
|
FileName = fileName,
|
||||||
Key = key,
|
Key = key,
|
||||||
Size = stream.Length
|
|
||||||
};
|
};
|
||||||
|
|
||||||
await _attachmentStorageService.UploadNewAttachmentAsync(stream, cipher, data);
|
await _attachmentStorageService.UploadNewAttachmentAsync(stream, cipher, data);
|
||||||
|
// Must read stream length after it has been saved, otherwise it's 0
|
||||||
|
data.Size = stream.Length;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user