Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
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.
Solved! Go to Solution.
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).
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.
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).
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.
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