Skip to main content
Solved

change destination folder depening on source folder

  • January 28, 2024
  • 2 replies
  • 118 views

Forum|alt.badge.img

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

 

Thanks

 

Best answer by James B

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. 

This topic has been closed for replies.

2 replies

James B
Forum|alt.badge.img
  • Employee
  • Answer
  • February 1, 2024

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. 


Forum|alt.badge.img
  • Author
  • Apprentice
  • February 2, 2024

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