cancel
Showing results for 
Search instead for 
Did you mean: 

File name change for zipped file from PayloadZipBean

0 Kudos

Hi

We are in PI 7.1 with SP9. We have flow from FTP NSF to FTP NSF only. we need to pick .xml and .pdf files and zip the files. In FTP NSF I have used Additional Payloads option to pick the pdf file with the same xml file name. In the receiver channel I have used

PayloadZipBean to zip both files. Issue is that zip file name is coming properly but the xml and pdf file names are changed. xml file name changed to MainDocument and the pdf file name changed to AdditionalFile.

Howe can I get the 2 files with the actual name of like how it was picked.

Example : Sender channel picking test.xml and test.pdf then I need zip file name like test.zip and it contains 2 files with the same actual names like test.xml and test.pdf

-Thanks -Lakshman

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member190293
Active Contributor

Hi Lakshman!

I would try to make use of "Content-Type" header both for main payload and attachment to store original file names.

Take a look at the thread describing the similar approach:

https://blogs.sap.com/2016/10/18/zip-file-using-payloadzipbean-preserving-original-file-name-inside-...

Author uses adapter module to set Content-Type, but the same result could be achieved by using message mapping, I guess.

Regards, Evgeniy.

JaySchwendemann
Active Contributor

Hi Evgeniy,

I know this is an old one but since the OP did not come back with a solution... 🙂

When talking message mapping, did you assume that the XML part of the file tuple would be actually mapped (hence the structure is known / stable or in other words the XML files do not differ in structur from another?

Would your suggestion also work in a pass through szenario?

TBH I until now did not have the requirement to simply zip a file in PI on a pass through szenario with the same file name (test.txt gets test.zip with inner test.txt) but I find it utterly amusing that this seems so hard that one needs to got through all the hoops and ultimately needs to develop an adapter module. Sometimes PI is brutaly simple, sometimes brutaly hard on such easy requirements.

Cheers

Jens

former_member190293
Active Contributor
0 Kudos

Hi Jens!

When talking about message mapping I actually meant java mapping or XSLT mapping, for example, where we just copy input payload to output and change content type.

In pass-through scenario we don't use ESR objects, so, we can't use mapping objects. In this case adapter module development could be the possible workaround.

Regards, Evgeniy.

markangelo_dihiansan
Active Contributor

Hi Lakshman,

You can use an OS command to zip the files and then use your sender comm channel to pick it up.

Regards,

Mark

former_member190293
Active Contributor

Hi Mark!

I guess, OS command for zipping files on FTP server, which is executed on PI server is rather complicated to implement.

Regards, Evgeniy.

JaySchwendemann
Active Contributor
0 Kudos

OP said something about NSF and mentioned something along the lines of "Additional Payloads option to pick the pdf file with the same xml file name". So I would assume that the source would be NSF.

Command Line zipping then should be feasible then, I guess? Or did I miss something

former_member190293
Active Contributor
0 Kudos

Hi Jens!

Yes, I guess you're right, but Lakshman said about FTP NFS and if SFTP adapter is used - we have the option to pick additional files as well.

Regards, Evgeniy.