cancel
Showing results for 
Search instead for 
Did you mean: 

Zip file write snap creating zip file with source folder structure , how to avoid file structure

kkishore
New Contributor III

Hi Team,

I am just reading the file from source location and writing the zip file in sldb, but it is creating the zip file with source structure when i unzip.

source file path is : /home/data/interface/inbound/filename.txt
when I unzip it, it has folder structure. here expectation is the zip file should have only file not file location structure

image

1 ACCEPTED SOLUTION

kkishore
New Contributor III

@j.angelevski ,@bojanvelevski,

Thank you , it is working…great

View solution in original post

16 REPLIES 16

j_angelevski
Contributor III

Hi @kkishore,

Place a Mapper between those two snaps and change the $['content-location'] header and be sure to select the 'Pass through' option in the Mapper.

Expression: $['content-location'].split("/")[$['content-location'].split("/").length - 1]
Target path: $['content-location']

image
image

This will remove the folder structure in the zip file.

kkishore
New Contributor III

@j.angelevski ,

Thanks for the response, I will try and let you know the results

j_angelevski
Contributor III

@kkishore,

The Mapper snap supports Binary Input/Output, you just need to select it from the Views tab in the Mapper.

image

@j.angelevski ,

I got it, thank you very much.