Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: upload direct to s3 via proxy

Abdullah Atta26eafcfee9e9
diff --git a/apps/web/src/interfaces/fs.ts b/apps/web/src/interfaces/fs.ts
index 0d9a0611f..49a3c09a0 100644
--- a/apps/web/src/interfaces/fs.ts
+++ b/apps/web/src/interfaces/fs.ts
@@ -300,20 +300,11 @@ async function singlePartUploadFile(
console.log("Streaming file upload!");
const { url, headers, signal } = requestOptions;
- const uploadUrl: string | { error?: string } = await fetch(url, {
- method: "PUT",
- headers,
- signal
- }).then((res) => (res.ok ? res.text() : res.json()));
- if (typeof uploadUrl !== "string")
- throw new Error(
- uploadUrl.error || "Unable to resolve attachment upload url."
- );
-
const response = await axios.request({
- url: uploadUrl,
+ url,
method: "PUT",
headers: {
+ ...headers,
"Content-Type": ""
},
data: await fileHandle.toBlob(),