A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: use mimetype when saving base64 data attachments
Abdullah Atta966130dc5276
diff --git a/apps/web/src/interfaces/fs.js b/apps/web/src/interfaces/fs.jsindex 3697a2b51..4dc99072a 100644--- a/apps/web/src/interfaces/fs.js+++ b/apps/web/src/interfaces/fs.js@@ -102,14 +102,14 @@ async function writeEncryptedFile(file, key, hash) {* 3. We encrypt the Uint8Array* 4. We save the encrypted Uint8Array*/-async function writeEncrypted(filename, { data, type, key }) {+async function writeEncrypted(filename, { data, type, key, mimeType }) {if (type === "base64") data = new Uint8Array(Buffer.from(data, "base64"));const { hash, type: hashType } = await hashBuffer(data);if (!filename) filename = hash;const file = new File([data.buffer], filename, {- type: "application/octet-stream"+ type: mimeType || "application/octet-stream"});const result = await writeEncryptedFile(file, key, hash);@@ -291,6 +291,7 @@ async function uploadFile(filename, requestOptions) {await fileHandle.addAdditionalData("uploaded", true);// Keep the images cached; delete everything else.if (!fileHandle.file.type?.startsWith("image/")) {+ console.log("DELETING FILE", fileHandle);await streamablefs.deleteFile(filename);}await checkUpload(filename);