cancel
Showing results for 
Search instead for 
Did you mean: 

PGPDecryption Module with SFTP Adapter not removing .pgp extension

Former Member
0 Kudos

Hi,

I am having a file-to-file scenario without any mapping using an SFTP adapter to File Adapter.

The file that the SFTP adapter picks up is encrypted and has a .pgp file extension, now, the file gets decrypted correctly using the PGPDecryption but the .pgp extension is kept when the the receiving File adapter receives the file.

Please help with the options of removing the *.pgp file extension on the channel without having to use any mapping objects.

Accepted Solutions (1)

Accepted Solutions (1)

arijit_mukherjee2
Participant
0 Kudos

Hi Treasure,Have you got any solution for the problem you were facing? Appreciate your feedback as I am facing the same problem with one of my scenario where I have to remove the ".pgp" extension after decryption of the input file.

Former Member
0 Kudos

Hi

How the file name is coming after decryption??

You can write an small adapter module for removing the .pgp extension from the file name.

Former Member
0 Kudos

Hi,

Yes I got a solution, I have used an OS command after processing on the adapter to rename the file.

My file was coming as filename.txt.pgp so my OS command was to strip out the .pgp extension.

Regards,

Treasure

arijit_mukherjee2
Participant
0 Kudos

Hi Treasure,

Can you please let me know the full command you used?Thanks in advance!!

Regards,

Arijit

Former Member
0 Kudos

Hi Arijit,

Sorry for the delay.

The command was: cmd.exe /C "ren %F %F*."

Where %F is the file name during runtime, there is also %f, I cannot remember what %f has, I think it is the file without an extension for %f.

How to test the command

From your windows OS, you can create a file.txt.pgp then run: CMD> ren file.txt.pgp file*.

The file will be renamed to file.txt because the *. addition on windows, assuming your PI server is running windows, removes the extension of the file which in the case of file.txt.pgp the .txt is not the extension, therefore removing the extension with a *. only removes the .pgp only.

Remark

In my scenario, I was picking the file from the SFTP with my sender channel only picking the files with a .pgp extension meaning I was always sure that my receiver channel will remove a .pgp extension only.

former_member197830
Participant
0 Kudos

Hi All,

I am  also facing same issue but in my case files need to be stored in below network path.

network path :   \\corf001\syscomm$\PI010\test\Archive\

Can any one help how is the OS command statement?

Thank you,

Narasaiah T.

akshaykumarmd333
Explorer
0 Kudos

Hi Arijit,

How the problem solved. I am also having same requirement. Please gprovide the solution how it resolved with out mapping.

Thanks & Regards,

NAgesh.

Answers (1)

Answers (1)

gagandeep_batra
Active Contributor
0 Kudos

Hi Treasure,

You can try Run OS command after message processing if  u are using NFS at reciver side and try  rename  command as follow

https://mail-attachment.googleusercontent.com/attachment/?ui=2&ik=ff3df31526&view=att&th=13faa5229878289c&attid=0.1&disp=inline&realattid=1439644572241100800-1&safe=1&zw&saduie=AG9B_P_SaqQ0mqiSUqZ1XExZx9tH&sadet=1380882601710&sads=fHDF8Vmua6Vs1W2ZxlMDTr7rSQc

Regards

gagan