Dim f As New FileInfo(Source_Path)
Using archive As ZipArchive = ZipFile.Open(Destination_Path, ZipArchiveMode.Update)
archive.CreateEntryFromFile(Source_Path, f.Name, CompressionLevel.Fastest)
End Using
I have tried the solution @John_Carter has suggested. I am getting compile error saying that ZipArchive is not defined.
I have added System.IO.Compression.FileSystem.dll to External References and System.IO.Compression to Namespace Imports on the Code Options tab in Initialise stage of the object.
I have tried the solution suggested in this topic and it worked well however it is not covering all I would like to do.
I appreciate any suggestions.
I am working with BluePrism 5 on Windows 7 Enterprise with Service Pack 1
Hi Bastian
Thank you in advance.
I have an one-file-archive. I want to decompress that archive save the file under a custom name. Based on your answer and the answer from @John_Carter and msdn documentation I came out with something like this:
Using archive As ZipArchive = ZipFile.OpenRead([ZipFileToUnzip])
For Each entry As ZipArchiveEntry In archive.Entries
entry.ExtractToFile([UnzipedFileFullPath])
Next
End Using
The above code leads to the following error:
Description: Compiler error at line 1: Type 'ZipArchive' is not defined.
On the Initialise page you'll need to add a Namespace Import for System.IO.Compression, and External References to System.IO.Compression.dll and I think System.IO.Compression.FileSystem.dll. Adding these is how the code stage can understand what ZipArchive means.
Hi Adam,
As John pointed out, NameSpace imports will probably help.
If you don't get it to work, don't worry and be pragmatic ?
You can already extract a zipfile to a folder, so if you create a temp folder, you can then loop trough it with Utility File management, do your actions, and then delete the tempfolder again.
@John thank you, adding the library System.IO.Compression.dll worked like a charm.
@Bastian being pragmatic is a must have in development 🙂 I just wanted to go one step deeper and understand the ""proper"" way of doing it