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

@kkishore,

And what type of file is this ? Is it .txt or something else ? What type of file are you reading ? Whatโ€™s the content-type in the sftp server ?

@j.angelevski ,

There is no extension for the file in the source system(reading file from source using file reader through sftp ). it is not txt file,but we can open with notepad or textpad
sample file name is : xyzdata

j_angelevski
Contributor III

@kkishore,

Iโ€™m not really sure why it adds the โ€ฆbin after the filename. Can you check the output after the Mapper and see if some extension is added unintentionally ?

kkishore
New Contributor III

@j.angelevski ,

there is no extension after the mapper.it is just file name .

screen shot below

image

bojanvelevski
Valued Contributor

I think the problem is that the ZipFile Writer , automatically detects that the incoming file has a binary structure, and adds .bin at the end. You can try and add a custom content-type header in the mapper, along with the content-location:

image