Hi all,
Recently i wrote an workflow to get all storage path status, but i need to save all of the result into an external resource like ftp or smb servers.
Can anyone suggest me the best practice?
Thank you
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";
ftpClient.putContent(content, "remotefile.txt");
- 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);
fw.open();
fw.write(fileContent);
fw.close();
var localFileFullName = localFile.path + "\" + localFile.name
// do the FTP upload here
ftpClient.putFile(localFileFullName, "whatever the name at the remote should be");
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";
ftpClient.putContent(content, "remotefile.txt");
- 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);
fw.open();
fw.write(fileContent);
fw.close();
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?