cancel
Showing results for 
Search instead for 
Did you mean: 

B1if generate Zip file

pierrecanali
Active Participant
0 Kudos

Hello Experts,

Is there a way to generate an .ZIP file within a Step in B1if?

Basically I need to generata an ZIP file with documents created in B1if Step.

Thanks in advance.

Pierre

Accepted Solutions (1)

Accepted Solutions (1)

pierrecanali
Active Participant
0 Kudos

Thanks to Maria Trinidad from SAP I had what I want and I'm ready to share.

Here's how I made it work:

  1. Generate your file/s
  2. Read your file/s with a GetFile atom (in my case PDFs, so I use bin as Payload Type)
  3. xsl:copy the GetFile payload into the predecessor of the StoreFile atom

Here is my Processing Flow:

GetFile atom details:

the xform (atom2.xsl) transformation:


<xsl:template name="transform">

     <bfa:io pltype="zip">

          <bfa:zipentry

               entryname="test.pdf" dataset="" group="" docname="" alias="" pltype="bin" properties="">

               <xsl:copy-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id=&apos;atom3&apos;]/bfa:io" />

          </bfa:zipentry>

     </bfa:io>

</xsl:template>

StoreFile atom details:

et Voilà I've got a freshly new test0000.zip file containing test.pdf in my c:/tmp directory.

This scenario step is not performing like a flash because of bin to char conversion so use your precautions, anyway it did the work fine for me.

Thanks again Maria for helpful info, hope this can help.

Regards

Pierre

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Pierre

You can use 'Call .NET' atom. For the newest B1iF version documentation says that you need to use > 4.0 version and it means that you can (most likely - I haven't tried it) take advantage of System.IO.Compression.ZipFile from .NET 4.5.

Check this:

c# - Create normal zip file programmatically - Stack Overflow

Kind regards,

Radek