How to move files to different ftp folders under the same root on the same server
Q: Conditional destination request. We are looking for an easy way (one channel) to move files to different ftp folders (more than 100 folders) under the same root on the same server, where filename prefix (3 char) is the key to which folder. Prefix and folder name are different.
- BBL > folder1
- ABB > folder2
- BYR > folder4
- BYP > folder5
- DAT > folder6
Please enable and add the following ‘On Destination’ Pascal Script:
- Please add the following script: link
- The script strips the first 3 characters from the filename by using ‘copy(psFilename, 1, 3)’
- The stripped part is compared with ‘BBL’, ‘ABB’ .. ‘DAT’
- Depending on the result of the compare, a folder name is added to our variable psVSA ( pascal script Var String A )
- This psVSA variable will be used in the Destination setup as parameter (%VSA, which contains data from psVSA)
- You’ll need to adjust the folder names and add more prefixes if needed
- Here we used the %VSA parameter, set in the Pascal Script, which contains the desired subdirectory name
That looks easy. Thank you very much.
If you need any help with this new option, please let us know.
Best Regards,
Limagito Team
#ftp #sftp #managedfiletransfer #filetransfer #filemanagement