• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Write file with Base64 encoding

New Here ,
Dec 09, 2018 Dec 09, 2018

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

TOPICS
Actions and scripting

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Beginner ,
Jan 16, 2019 Jan 16, 2019

Copy link to clipboard

Copied

bump

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Jan 22, 2019 Jan 22, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 23, 2019 Jan 23, 2019

Copy link to clipboard

Copied

LATEST

my solution was to write the file from the panel and pass the path to the jsx

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines