There is an <input type="file" id="upload" accept="application/pdf"/>
that accepts the pdf that should be saved to a location within the electron app. Saving a file with fs is working just fine but I can't figure out how it works with a pdf. I don't know what I need to hand over to writeFileSync()
for data and encoding.
function upload(path){
"use strict";
var fs = require('fs');
var file = $("#upload").prop("files")[0];
try {
fs.writeFileSync(path, foo, bar);
} catch(e) {
console.log(e);
}
}