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 {