CEP readfile problem

Contributor ,
May 28, 2021 May 28, 2021

Copy link to clipboard

Copied

Hi,

 

I am trying to open a JSON file from a CEP panel.

File open dialog works fine and returns a file name like c:/tmp/test.json

readFile(filename, cep.encoding.UTF8) results in an error 2 (invalid parameter)

The json was saved with a writeFile call before and looks fine - it contains extended characters and has no BOM

What could be wrong?

TOPICS
Scripting

Views

179

Likes

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 Professional ,
May 28, 2021 May 28, 2021

Copy link to clipboard

Copied

Hi,

Try the following

 

var data = cep.fs.readFile(file);

 

 

file - complete path to the file. In your case C:/tmp/test.json

 

 

Best regards

Likes

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
Contributor ,
May 30, 2021 May 30, 2021

Copy link to clipboard

Copied

Hi,

 

I tried that first, then I added the second parameter

 

Kind regards

Likes

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 Professional ,
Jun 01, 2021 Jun 01, 2021

Copy link to clipboard

Copied

LATEST

So, it doesn't work for you?

 

Best regards

Likes

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