From c1771bb117eeb4162505204589017dca60888239 Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Sun, 27 Feb 2022 21:45:00 +0800 Subject: [PATCH] use arraybuffer instead of uint8array --- src/remoteForDropbox.ts | 2 +- src/remoteForOnedrive.ts | 2 +- src/remoteForS3.ts | 2 +- src/remoteForWebdav.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/remoteForDropbox.ts b/src/remoteForDropbox.ts index 67dc8bf..eb290bf 100644 --- a/src/remoteForDropbox.ts +++ b/src/remoteForDropbox.ts @@ -456,7 +456,7 @@ export const uploadToRemote = async ( let localContent = undefined; if (uploadRaw) { if (typeof rawContent === "string") { - localContent = new TextEncoder().encode(rawContent); + localContent = new TextEncoder().encode(rawContent).buffer; } else { localContent = rawContent; } diff --git a/src/remoteForOnedrive.ts b/src/remoteForOnedrive.ts index 5a40f47..bf82f24 100644 --- a/src/remoteForOnedrive.ts +++ b/src/remoteForOnedrive.ts @@ -690,7 +690,7 @@ export const uploadToRemote = async ( let localContent = undefined; if (uploadRaw) { if (typeof rawContent === "string") { - localContent = new TextEncoder().encode(rawContent); + localContent = new TextEncoder().encode(rawContent).buffer; } else { localContent = rawContent; } diff --git a/src/remoteForS3.ts b/src/remoteForS3.ts index 2fbf123..7601c55 100644 --- a/src/remoteForS3.ts +++ b/src/remoteForS3.ts @@ -141,7 +141,7 @@ export const uploadToRemote = async ( let localContent = undefined; if (uploadRaw) { if (typeof rawContent === "string") { - localContent = new TextEncoder().encode(rawContent); + localContent = new TextEncoder().encode(rawContent).buffer; } else { localContent = rawContent; } diff --git a/src/remoteForWebdav.ts b/src/remoteForWebdav.ts index bc8724f..8acdc1c 100644 --- a/src/remoteForWebdav.ts +++ b/src/remoteForWebdav.ts @@ -182,7 +182,7 @@ export const uploadToRemote = async ( let localContent = undefined; if (uploadRaw) { if (typeof rawContent === "string") { - localContent = new TextEncoder().encode(rawContent); + localContent = new TextEncoder().encode(rawContent).buffer; } else { localContent = rawContent; }