Support Questions

Find answers, ask questions, and share your expertise

Creating (moving) folders with PutSFTP

avatar
New Contributor

Hello

I need to move files from server A to server B. At the moment im using ListSFTP > FetchSFTP > PutSFTP processors and its moving only files (also from subdirectorys). So its like this:
ServerA:
input/folder1/file1
input/folder2/file2
After moving:
ServerB:
output/file1
output/file2

I need it to be:
ServerB
output/folder1/file1
outout/folder2/file2

PutSFTP has the configuration for remote path "output/" and create directory "True". Should I use some other processor in the middle or change the configuration to get the subfolders also, not just the files?

2 REPLIES 2

avatar
New Contributor

So at the moment if I check the files in the queue before PutSFTP processor, they have path "infput/folder1/" and sftp.remote.filename "input/folder1/file1". 
Should I change them with UpdateAttribute processor to "output/folder1/" and "output/folder1/file1"?

avatar
New Contributor

So I added two separate UpdateAttribute processors.
First one creates field folder: ${path:substringAfter("/input/"):substringBefore("*")}

Second one create field path.new: /output/${folder}

And then in the PutSFTP I change the Remote Path property to ${path.new}/

This also lets me get subdirectorys and files from there correctly if needed.