Enable multipart uploads for all cloudflare uploads via uppy. this fixes upload errors with files < 100MB

This commit is contained in:
Sven Herrmann 2024-10-17 14:09:56 +02:00
parent b4976d5a30
commit 77405deb35
1 changed files with 3 additions and 0 deletions

View File

@ -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));