From 77405deb35cf9cfa0017cc4df3ef00a21fafe01f Mon Sep 17 00:00:00 2001 From: Sven Herrmann Date: Thu, 17 Oct 2024 14:09:56 +0200 Subject: [PATCH] Enable multipart uploads for all cloudflare uploads via uppy. this fixes upload errors with files < 100MB --- libraries/react-shared-libraries/src/helpers/uppy.upload.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/react-shared-libraries/src/helpers/uppy.upload.ts b/libraries/react-shared-libraries/src/helpers/uppy.upload.ts index 78bd6002..d8704d56 100644 --- a/libraries/react-shared-libraries/src/helpers/uppy.upload.ts +++ b/libraries/react-shared-libraries/src/helpers/uppy.upload.ts @@ -25,6 +25,9 @@ export const getUppyUploadPlugin = (provider: string, fetch: any, backendUrl: st return { plugin: AwsS3Multipart, options: { + shouldUseMultipart(file : any) { + return true; + }, createMultipartUpload: async (file: any) => { const arrayBuffer = await new Response(file.data).arrayBuffer(); const fileHash = sha256(Buffer.from(arrayBuffer));