How to Compress and uncompress ( zip/unzip)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-02-18 05:41 AM
Dear All,
Can someone help me in Compress and un compress ( zip/unzip) folder.
Thanks
in advance
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-03-18 04:19 PM
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)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
20-09-18 07:20 PM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
21-09-18 05:44 PM
@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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
21-09-18 07:22 PM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
13-11-18 05:59 PM
Thanks Bastiaan, with your help I managed to implement the action as well.
