cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Translate the entire conversation x

CreoJS API Reading files from network drives

ilyachaban
16-Pearl

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.

8 REPLIES 8

Result of using provided code:

ilyachaban_0-1769434291085.png

 

Do you have web_link_file_read config option set to yes?

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

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


@ilyachaban wrote:

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


It probably has to be a mapped drive.

I've tried 3 ways to call the drive. One of them was mapped drive, second one was ip adress, and third one UNC path. Nothing worked. But if i use local 😧 or C: drive it reads file fine.

RPN
17-Peridot
17-Peridot
(To:ilyachaban)

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?

 

 

ilyachaban
16-Pearl
(To:RPN)

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

ilyachaban_0-1769588024801.png


Does network drive counts as local????

Announcements

Top Tags