Forum Discussion

DMG's avatar
DMG
New Contributor
2 years ago

How to PGP-Encrypt a file with a filename read from another branch

I am using a PGP Encrypt snap to encrypt an XML file, and this snap allows to define the "Encrypted filename" either fixed or based on a formula, but the snap only has one input.

How can I possibly set the filename using a value coming from another branch?

Basically, I don't know the filename of the original file "filename.xml" to encrypt, until the file appears on an SFTP folder. The pipeline is supposed to read the file using a Directory Browser and File Reader, create a PGP encrypted file named "filename.xml.pgp" and save it with a File Writer.

I could use a Copy after the Directory Browser to read the filename, add an output to the File Writer, connect it with a Join to the filename, and use a File Operation to rename the already encrypted file. However, I believe renaming a file after encryption actually breaks the encryption.

The File Writer does not allow a second input, and the only input is used by a XML Formatter, is there a way to include the filename in this input for use by the PGP Encrypt snap, without it  becoming also an XML element in the file itself?