From a42f401d8d319b6d4de72c350767e474b1dc6ba3 Mon Sep 17 00:00:00 2001 From: KishenKumarrrrr Date: Thu, 8 Feb 2024 18:17:34 +0800 Subject: [PATCH] fix: file upload to s3 --- backend/src/core/middlewares/file-attachment.middleware.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/src/core/middlewares/file-attachment.middleware.ts b/backend/src/core/middlewares/file-attachment.middleware.ts index 7f59bfe78..92168d25d 100644 --- a/backend/src/core/middlewares/file-attachment.middleware.ts +++ b/backend/src/core/middlewares/file-attachment.middleware.ts @@ -176,12 +176,11 @@ async function uploadFileToPresignedUrl( ) try { // 3. Upload file to presigned URL - const response = await axios.put(presignedUrl, uploadedFile, { + const response = await axios.put(presignedUrl, uploadedFile.data, { headers: { 'Content-Type': uploadedFile.mimetype, }, withCredentials: false, - timeout: 30 * 1000, // 30 Seconds }) // 4. Return the etag and transactionId to the FE const formattedEtag = removeFirstAndLastCharacter(response.headers.etag)