1 person found this helpful
SMB would probably require providing Command access which is a security risk so FTP is safer & vRO has an FTP client class
You can use it to either
- send content to a remote file
this one is simple
var content = "some content";
- create a local file on the vRO appliance and upload that.
You will need to have the capability to create a local file on the vRO appliance but you can the following to create a temp file and write your content to it, then upload to the remote with the desired name.
// assume your file content is in this var
var fileContent = "whatever the content should be";
var localFile = System.createTempFile(".txt"); // create a temp file with the given suffix
FileWriter fw = new FileWriter(localFile);
var localFileFullName = localFile.path + "\" + localFile.name
// do the FTP upload here
ftpClient.putFile(localFileFullName, "whatever the name at the remote should be");
Thank you for your response
But where should i define my ftp server address and credentials?
- var ftp = new FTPClient();
- ftp.connect("10.20.123.135", "21"); // sample ip, port
- ftp.login("user", "pass"); // sample username, password
- System.log("cwd -> " + ftp.cwd); // print current directory
- ftp.makeRemoteDirectory("/tmp6"); // create a new directory
- ftp.cwd = "/tmp6"; // changes current directory to the newly created one
- System.log("cwd -> " + ftp.cwd); // print the new current directory