I have a working mapping node that creates a dated folder on a local network but I now need to change it to do the same for SFTP but I'm not sure how to change my existing code to do this. Using information I found here I came up with the following code for creating the dated folder on a local network:
var fulldate = qie.getSystemDate();
var year = qie.formatDate('yyyy', fulldate);
var month = qie.formatDate('MM', fulldate);
var day = qie.formatDate('dd', fulldate);
var folder = "" + year + "-" + month + "-" + day;
var fullPath = qie.evaluateTemplate("\\\\Interface\\Archive\\"+folder+"\\");
var fullPathDirectory = new java.io.File(fullPath);
if (!fullPathDirectory.exists()) {
fullPathDirectory.mkdirs();
}
messageCache.setValue('fullPath', fullPath);
I then use {c:fullPath}\*.* for the destination path.
How can I combine what I already have with the SFTP example to create a dated folder on the SFTP server and then write to that folder?