Copy link to clipboard
Copied
I'm trying to write a Base64 string to a png file as part of a CEP extension.
I can do this with:
var filename = "/path/to/file.png";
var data = /*base64 string*/;
window.cep.fs.writeFile(filename, data, window.cep.encoding.Base64);
but ideally I'd do it inside my JSX file. Is this possible or do I need to stick with the above in my .JS file?
Thanks
Copy link to clipboard
Copied
bump
Copy link to clipboard
Copied
var f = new File("/path/to/file.png");
if (f.open('w')) {
f.write(data);
f.close();
}
More information available in the JavaScript Tools Guide pdf (part of ESTK install). There is f.encoding but I don't see any mention of Base64 as an option.
Copy link to clipboard
Copied
my solution was to write the file from the panel and pass the path to the jsx