Skip to main content
1月 26, 2026 1:28 下午 UTC
已解决

CreoJS API Reading files from network drives

Hello, is there any possibility to read files from network drives?

try {
 print(readFileAsString("\\\\10.170.84.24\\Standard\\ProE_standard\\Relace\\Relace PRT.txt"));
} catch (e) {
 print("FAILED: " + e);
}

 
I need to read fresh relations so all models actual relations. The only one place in our company provides relations is network drive.

RPN回答
2月 6, 2026 3:36 上午 UTC

You followed this settings:

Not sure, but web based apps have no access to file folders, make sure to add the config path.

 

 

 

10回复

1月 26, 2026 1:31 下午 UTC

Result of using provided code:

ilyachaban_0-1769434291085.png

 

1月 26, 2026 9:44 下午 UTC

Do you have web_link_file_read config option set to yes?

https://www.ptc.com/en/support/article/CS156638

1月 27, 2026 5:43 上午 UTC

Yes, I do and it works if I read from 😧 or C: drives. But when i reach out to network drive it can't read a thing

1月 28, 2026 2:57 上午 UTC

Did you also tried without the.blank character, here

„Replace PRT.txt“ with „Replace_PRT.txt“

 

try {

  print(readFileAsString("\\\\10.170.84.24\\Standard\\ProE_standard\\Relace\\Relace_PRT.txt"));

} catch (e) {

  print("FAILED: " + e);

}

 

Or replace the IP by the hostname, or copy the file to a local one or change the directory first.

Is readFileAsString Unicode?

 

 

1月 28, 2026 8:12 上午 UTC

Renaming file doesn't do anything due to reading same file but from C: or 😧 drive works without problem

1月 28, 2026 8:14 上午 UTC

ilyachaban_0-1769588024801.png


Does network drive counts as local????

RPN回答
2月 6, 2026 3:36 上午 UTC

You followed this settings:

Not sure, but web based apps have no access to file folders, make sure to add the config path.

 

 

 

2月 6, 2026 7:20 上午 UTC
  • creo_js_app.conf:
    • readable_folders = ${CWD}; C:\xxx\xxx;
    • writable_folders = ${CWD}; C:\xxx\xxx;

IT WORKED. Thank you so much.

P.S.

I want the PTC community to understand just how close I am to swearing in this thread.

I’ve spent two weeks on what should be a basic task: reading a file from disk. The blocker is a config file that has no documentation—not even the basics. There’s no reference for its syntax, no list of options, no explanation of what it controls or how it’s supposed to be used. Just… nothing.