From d90763dd3c88008454a0cbe0a51175cfa454af0d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 31 May 2024 17:59:16 +0100 Subject: [PATCH] Getting size parameter right for streams. --- packages/server/src/integrations/utils/utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/integrations/utils/utils.ts b/packages/server/src/integrations/utils/utils.ts index 9f04457d7a..be689fbfd3 100644 --- a/packages/server/src/integrations/utils/utils.ts +++ b/packages/server/src/integrations/utils/utils.ts @@ -368,13 +368,16 @@ export async function handleFileResponse( size = parseInt(contentLength, 10) } - await objectStore.streamUpload({ + const details = await objectStore.streamUpload({ bucket, filename: key, stream, ttl: 1, type: response.headers["content-type"], }) + if (!size && details.ContentLength) { + size = details.ContentLength + } } presignedUrl = objectStore.getPresignedUrl(bucket, key) return {