change destination folder depening on source folder

  • 28 January 2024
  • 2 replies

Userlevel 1

Dear all, 

I have a ftp connector that is reading from multiple folders/subfolders and transferring data to a local server using an sftp connector

I would need to either be able to set the destination folder in my local server depending on the remote source folder or to put everything in the same folder but renaming the file in such a way I can understand from where they were coming from 

Currently the only way I found was to use several correctors (one for each folder), but I am doing to many connections to the server and using too many  connectors for my license





Best answer by James B 1 February 2024, 22:20

View original

2 replies

Userlevel 6

There is a Subfolder header that is supported in multiple connectors in CData Arc where there is the concept of a folder structure in the transport protocol - notably the File, SFTP (client) and FTP (client) connectors:


Subfolder Headers


The Subfolder header is preserved as metadata on messages that you pass through CData Arc, and has the following effects:


If you send a message with a subfolder header to a connector that supports it, the subfolder header will be added to the path that is used when the file is uploaded, relative to the upload path. For example, if the SFTP connector upload path is /home/uploads/ and the subfolder is /foo, the file will be uploaded to /home/uploads/foo. 


If you receive a message from a connector’s subfolder (by using the Advanced->Recurse remote subdirectories setting of that connector), this will receive the message with the subfolder relative to the path that you pick up from. 


This means that for transfers to/from File, SFTP and FTP, you can transfer entire directory trees so long as the subfolder headers are used. To try it out, make sure that Recurse remote subdirectories is set on the connector that picks up the files. 

Userlevel 1

Thanks a lot!!! Really useful

I can see that I could use this to rename the file with folder information before saving.

Do you think I could use this information to change also the destination folder ? I have same structures on both side