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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

How to send files to another server

Yoshihiko.N
13-Aquamarine

How to send files to another server

Dear all,

 

I want to send files which created on ThingWorx to another server.

The flow is below and want to know how to do "2".

 

1. Create a file on ThingWorx.

2. Send it to another server.

 

Kindly let us know.

1 ACCEPTED SOLUTION

Accepted Solutions

To transfer from one ThingWorx server (From repository) to another different server you would need a protocol to connect and transfer content over it. If your another server does have a REST end point you can try ThingWorx content loader functions to do this. Otherwise you can write your custom utility/extension which will pick up the files from one TWX repository and place it to your desired server location or else you can have a ThingWorx SDK on another server and can transfer file over WS protocol (This would be least recommended as you will be using SDK only for transfer purpose). 

View solution in original post

6 REPLIES 6

If it is about sending the created file on one TWX server to another TWX server, you can use federation and do the transfer - https://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/index.html#page/ThingWorx/Help/Composer/System/Subsystems/FileTransferSubsystem.html
This is one of the way, there can be other ways as well.

Yoshihiko.N
13-Aquamarine
(To:mnarang)

Thank you for your reply.

 

I want to send files(xml file) from one TWX server to another server( not TWX server ).

Destination server is application server and the sent file will be used for application running on it.

 

Could you kindly tell us which solution is best ( better ) for this purpose ?

To transfer from one ThingWorx server (From repository) to another different server you would need a protocol to connect and transfer content over it. If your another server does have a REST end point you can try ThingWorx content loader functions to do this. Otherwise you can write your custom utility/extension which will pick up the files from one TWX repository and place it to your desired server location or else you can have a ThingWorx SDK on another server and can transfer file over WS protocol (This would be least recommended as you will be using SDK only for transfer purpose). 

wposner-2
12-Amethyst
(To:mnarang)

You can copy files using the built in uploader tool and REST. This can be found at <TWX URL>/Thingworx/FileRepositoryUploader.

 

You need to include the appkey in your header along with 

"X-XSRF-TOKEN": "TWX-XSRF-TOKEN-VALUE"

 

In your body, specify the repo to where you want to upload.  In Java it would look like:

builder.addTextBody("upload-repository", "SourceControlFileRepository", ContentType.TEXT_PLAIN);

 

You'll need to attach your content as binary and then issue the POST.  You can easily replicate this in Postman using the info that I've provided above.  I think Postman will even generate the code you would need to execute the POST programmatically.

You can store xml files which you want to share on 'Systemrepository'.

 

On Thingworx server you would find those files at location - /ThingworxStorage/repository/SystemRepository/ 

 

You need to write a shell script to Copy files from Source server to destination Server.

slangley
23-Emerald II
(To:Yoshihiko.N)

Hi @Yoshihiko.N.

 

If you feel your question was answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.

 

Thank you for your participation in the community!

 

Regards.

 

--Sharon

 

 

Top Tags