mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
revert base64 encoding before passing file to IPC
This commit is contained in:
parent
d843e716b7
commit
2534604616
|
@ -550,7 +550,7 @@ ipcMain.on('save-file-to-folder',(event,data)=>{
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
let buffer = Buffer.from(atob(data.file));
|
let buffer = Buffer.from(data.file);
|
||||||
let arraybuffer = Uint8Array.from(buffer);
|
let arraybuffer = Uint8Array.from(buffer);
|
||||||
console.log(arraybuffer)
|
console.log(arraybuffer)
|
||||||
fs.writeFile(filepath.filePath, data.file, 'binary', function (err, data) {
|
fs.writeFile(filepath.filePath, data.file, 'binary', function (err, data) {
|
||||||
|
|
|
@ -863,7 +863,7 @@ function saveFileToFolder(id) {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
// we need to encode data because of error "an object could not be cloned"
|
// we need to encode data because of error "an object could not be cloned"
|
||||||
let Data = {
|
let Data = {
|
||||||
file: btoa(data),
|
file: data,
|
||||||
filename: filename,
|
filename: filename,
|
||||||
filetype: filetype,
|
filetype: filetype,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue