cancel
Showing results for 
Search instead for 
Did you mean: 

How to Compress and uncompress ( zip/unzip)

VenkatRamana
Level 3
Dear All,   Can someone help me in Compress and un compress ( zip/unzip) folder.   Thanks in advance
5 REPLIES 5

BastiaanBezemer
Level 5
Hi Qtramana, You need to make your own code stage. In your object, in your initialize page, set a reference to: System.IO.Compression.FileSystem.dll And in your code stage, you need just one line: System.IO.Compression.ZipFile.CreateFromDirectory([Directory to Zip], [ZipFileToCreate])   With as input [Directory to Zip] (e.g. C:\Temp) and [ZipFileToCreate] (e.g. C:\MyZipFile.zip) And unzip is similar, see the documentation on:https://msdn.microsoft.com/en-us/library/system.io.compression.zipfile(… System.IO.Compression.ZipFile.ExtractToDirectory([ZipFileToUnzip], [FolderToUnzipIn]) This .Net class is available since .Net version 4.5, so it will work in BluePrism 5 & 6, but not in BluePrism 4 (Except if you trick it to use .Net version 4.5)

AmithRajagopal
Level 4
Hi Bastiaan, Your code really worked , but can you please provide something for .zipx file format .. have you done this before ?.. Using the above method its not uncompressing .zipx files .   Warm regards, amith

AndreyKudinov
Level 10
@amith1990, google says there is no libs for zipx: https://stackoverflow.com/questions/1200289/i-need-a-c-sharp-library-for-zipx You can still use commandline tool for it.

AmithRajagopal
Level 4
Thanks aikudino. But i already had the above said outputs (google said no results and that stackoverflow link is not of that use).   Regards Aikudino

AleksandrNikuli
Level 3
Thanks Bastiaan, with your help I managed to implement the action as well.