09-23-2020 02:58 PM
Hi, I want to download all the files in a remote SFTP server to the Files folder. I think this is a pretty simple task but I am new, so I am not sure what to do.
So I am thinking of using these 2 snaps
but I have problem about the output file names. If on my remote server has file1.txt, file2.txt, file3.txt then I want to download the exact file names to my files folder.
What do I put in the file name?
Thanks
Solved! Go to Solution.
09-24-2020 09:59 AM
The output file should be decrypted already, but with the encrypted filename.$['content-location']
will be the url of the encrypted file because File Writer is connected to PGP Decrypt.
You could replace or append the file extension if you know what the original extension is.
.replace('pgp', 'txt')
+ ".txt"
09-23-2020 03:58 PM
You could use the following expression to get the filename from the input header.
$['content-location'].substr($['content-location'].lastIndexOf('/') + 1)
$['content-location']
represents the absolute path of the input file and the expression will remove everything from the beginning to the last forward slash.
09-24-2020 08:16 AM
Thanks for your help @siwadon
If I want to decrypt all the encrypted files from FTP server before I download them to my files folder, I added the Decrypt snap as below
but when I run it, the downloaded files are still with extension PGP. They are not decrypted.
How do I decrypt them?
09-24-2020 09:59 AM
The output file should be decrypted already, but with the encrypted filename.$['content-location']
will be the url of the encrypted file because File Writer is connected to PGP Decrypt.
You could replace or append the file extension if you know what the original extension is.
.replace('pgp', 'txt')
+ ".txt"