Skip to content

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

mobile: fix attachment upload from base64

Ammar Ahmedbbf0fb641be9
diff --git a/apps/mobile/app/common/filesystem/io.js b/apps/mobile/app/common/filesystem/io.js
index a2a134147..ed405fbfb 100644
--- a/apps/mobile/app/common/filesystem/io.js
+++ b/apps/mobile/app/common/filesystem/io.js
@@ -67,7 +67,7 @@ export async function hashBase64(data) {
};
}
-export async function writeEncryptedBase64({ data, key }) {
+export async function writeEncryptedBase64(data, key) {
await createCacheDir();
let filepath = cacheDir + `/${getRandomId("imagecache_")}`;
await RNFetchBlob.fs.writeFile(filepath, data, "base64");
@@ -77,6 +77,8 @@ export async function writeEncryptedBase64({ data, key }) {
});
RNFetchBlob.fs.unlink(filepath).catch(console.log);
console.log("encrypted file output: ", output);
+ output.size = output.length;
+ delete output.length;
return {
...output,
alg: "xcha-stream"