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

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

432

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 Expert ,
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

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
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

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

Copy link to clipboard

Copied

LATEST

So, it doesn't work for you?

 

Best regards

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