How to zip multiple Folder into single ZipFile?

tutorial
studio
zip

#1

@Arvin_Gabriel_Mari_A
@badita
@vvaidya
@aksh1yadav

I have folder as “sample” inside that i have no.of sub folder.
I need to compress all the sub folder into one zip file ( Zip file format is “Source EOD dd-mm.zip” )
Can someone help to achieve this


#2

I can able to read all the sub folders but i am not able to zip those sub folders into one Zipfile

Syntax to use zip folder ==> ZipFile.CreateFromDirectory(sourcepath,zipPath,CompressionLevel.Fastest)

Is this right way i am using to zip those folders or any other way to do this

please suggest me how to do this

Thanks in advance
Jothyprasanth M


#3

ZipFile.CreateFromDirectory should work.

Open your xaml in notepad and add below manually.

[/uploads/uipath/original/2X/8/8116f8ee3b8c0b0645367f6735018b1ea60bee93.png]

[/uploads/uipath/original/2X/f/f1e0ee1ebd527d338208f547a858d0b53dd6b83d.png]

[/uploads/uipath/original/2X/6/6a4dcb4ecc6644c6d86469b2ab2bf9ef10a5ab18.png]


#4

<AssemblyReference>System.IO.Compression.FileSystem</AssemblyReference>

CompressFolders.xaml (5.96 KB)


How to Zip mutiple folders into a single zipfile?
#5

Its working fine Thatnk you for giving me the solution


#6

Is it possible to create zipfile using password too?


#7

Is it possible to create Zip file using password?


#8

With System.IO.Compression you can not set a password, acording to this:

http://msdn.microsoft.com/en-us/library/system.io.compression(v=vs.90).aspx


#9

Hi @vvaidya and @jothyprasanth.m

When I tried the solution XMAL it is working fine , but once I linked it with my solution , same error occurred.

I need to add only Assembly or other below 3 lines as well

[/uploads/uipath/original/2X/8/8116f8ee3b8c0b0645367f6735018b1ea60bee93.png]

[/uploads/uipath/original/2X/f/f1e0ee1ebd527d338208f547a858d0b53dd6b83d.png]

[/uploads/uipath/original/2X/6/6a4dcb4ecc6644c6d86469b2ab2bf9ef10a5ab18.png]


#10

Hi vvaidya,

How to create multiple folder into a single file, Thanks


#11

Hi @Sharanabasava,
I thank to you to initiate me to give new provision in the zip file activity. Now you can able to do zip with multiple folders.

Regards
Balamurugan