Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Solved! Go to Solution.
+1 for Mukul's answer.
We don't allow saving files anywhere outside of the FileRepositories for security reasons.
Even if you use an extension to do this, I would expect for any properly secured system that the user under which Tomcat (and subsequently ThingWorx) runs does not have access to write to those folders.
saveXML is a snippet under File repository thing. So if you give the path for file repo and content as XML it will save the file as a XML document in your file repository. For example I have a TestRepo thing with template as FileRepository and if I execute this service on the Thing it give me the required xml in TestRepo of ThingWorx.
me.SaveXML({
path: "test1.xml" /* STRING */,
content: '<languages type="dynamic"><lang>JavaScript</lang> <lang>Python</lang></languages>' /* XML */
});
After executing above I will get test1.xml in root of my TestRepo folder under ThingworxStorage->repository folder.
Thank you for your reply but I would like to know how to create xml files on local directory not repository folder.
Thingworx can save different type of files in it's repository but AFAIK there is no OOTB way to save an xml directly into local. You can write a custom Java extension to either write it into your local or pick from Thingworx repository and move it to your desired local location.
Thanks,
Mukul Narang
+1 for Mukul's answer.
We don't allow saving files anywhere outside of the FileRepositories for security reasons.
Even if you use an extension to do this, I would expect for any properly secured system that the user under which Tomcat (and subsequently ThingWorx) runs does not have access to write to those folders.