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