cancel
Showing results for 
Search instead for 
Did you mean: 

How to encode (base64 format) a zip file?

pradeep_moganti
New Contributor II

Hello Everyone!

We are planning to build a pipeline to achieve the following scenario.

Extract Oracle Data → Create a CSV File → Zip CSV file → Convert Zip file to Base64 Format.

We build the pipeline as following. We were able to do all activities till zipping the file but, we didnt find any Snaps available to convert Zip file to Base64 format.

image

We saw mapper has functionality to convert the contents into Base64 format but, we didnt find any Snap that can convert entire zip file into Base64 format.

Please help with your suggestions if anyone come across or have some idea to achieve this?

Thanks,
Pradeep.

4 REPLIES 4

cjhoward18
Employee
Employee

you can use the expression Base64.encode(GZip.decompress($content)) in a mapper to decompress your zipped file and encode it into Base64 format.

Where $content is your zipped file

pradeep_moganti
New Contributor II

@cjhoward18

I am unable to setup the mapper. Do you know how the mapping should be?

image

@pradeep.moganti If you want encoded format content before writing to zip, use mapper after csv parser, change the input view and output view of mapper as binary (pfa screenshot)then use the expression - Base64.encode(GZip.decompress($content)) and then connect in zip write.
image.
If you want to format after file write, then first read the zip file and then use the mapper as I mention below

pradeep_moganti
New Contributor II

Bumping up!