Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to extract a zip file that contains several other zips files

avatar
New Contributor

Hi

I've zip file that contains several other zips files.

I want to extract the main ZIP and all other zips files (Recursive)

Can anyone please advise how to do this using NIFI ?

1 ACCEPTED SOLUTION

avatar
Super Guru

@Nifi_Al ,

 

Here's a way to do that:

 

araujo_0-1648116148018.png

 

The RouteOnAttribute processor checks the file name and if it's a ZIP file it sends it for unpacking. Otherwise sends the non-zip file downstream.

 

araujo_1-1648116231378.png

Cheers,

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

View solution in original post

2 REPLIES 2

avatar

@Nifi_Al  Use getFile/putFile to read and write in your flow.  Then If you use unpackContent against a zipped flowfile it should create individual artifacts flowfiles which can be additionally unzipped further.   Alternatively, if you can create a script to unzip recursively, you can use nifi to executeScript. Maybe even use executeProcess too.

avatar
Super Guru

@Nifi_Al ,

 

Here's a way to do that:

 

araujo_0-1648116148018.png

 

The RouteOnAttribute processor checks the file name and if it's a ZIP file it sends it for unpacking. Otherwise sends the non-zip file downstream.

 

araujo_1-1648116231378.png

Cheers,

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.