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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to get path of the file in Thingworx custom File repository(Thingworx Cloud 9.1)

VaibhavShinde
16-Pearl

How to get path of the file in Thingworx custom File repository(Thingworx Cloud 9.1)

Hi ,

I am looking to access a file from File repository in twx , using below script.

i need Source Directory , source file name to be mentioned from Twx custom file repository  to run this code.

 

VaibhavShinde_0-1646552511358.png

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
Mukul
13-Aquamarine
(To:VaibhavShinde)

And your specific file can be stored anywhere in File Repository, it does not need to be in the root, correct? If that's correct then I believe you have to first get all the directories and then loop through to get all the file links. Once you have that, you can pick your file name from it and the associated link. This has already been discussed here:

https://community.ptc.com/t5/ThingWorx-Developers/List-all-files-in-a-File-Repository-TXW-9-1/td-p/716846

 

Let me know if my understanding is not correct, if that's the case I would request you to elaborate more. 


Thanks,

Mukul Narang

View solution in original post

3 REPLIES 3
Mukul
13-Aquamarine
(To:VaibhavShinde)

you can browse a ThingWorx repository using "BrowseDirectory" or "BrowseFileSystem" service in your repository. Using these services you can get all the directories and files (with name and path) available in your repository. 

Hi @Mukul 

I need to see the path of the specific file which is stored in File Repository, if we try to execute "BrowseDirectory" or "BrowseFileSystem" services

service itself need PATH as input. 

 

Thanks,

 

Mukul
13-Aquamarine
(To:VaibhavShinde)

And your specific file can be stored anywhere in File Repository, it does not need to be in the root, correct? If that's correct then I believe you have to first get all the directories and then loop through to get all the file links. Once you have that, you can pick your file name from it and the associated link. This has already been discussed here:

https://community.ptc.com/t5/ThingWorx-Developers/List-all-files-in-a-File-Repository-TXW-9-1/td-p/716846

 

Let me know if my understanding is not correct, if that's the case I would request you to elaborate more. 


Thanks,

Mukul Narang

Top Tags