Skip to content

Commit 819a6dd

Browse files
authored
Merge pull request #140 from arduino/feature/download-file-as-binary
Implementing binary file open/download (requires micropython.js 1.5.0)
2 parents 4e139e6 + ae2c82a commit 819a6dd

File tree

5 files changed

+104
-114
lines changed

5 files changed

+104
-114
lines changed

backend/ipc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ module.exports = function registerIPCHandlers(win, ipcMain, app) {
4343

4444
ipcMain.handle('save-file', (event, filePath, content) => {
4545
console.log('ipcMain', 'save-file', filePath, content)
46-
fs.writeFileSync(filePath, content, 'utf8')
46+
const data = Buffer.from(content);
47+
fs.writeFileSync(filePath, data)
4748
return true
4849
})
4950

0 commit comments

Comments
 (0)