Is there any solution to this issue yet.
I want to extract .GZ file but cant find any activity for this as it exist for System.io.compression.ZipFile.ExtractToDirectory
I also tried with BalaReva package for unzipping file, this works fine but for customer we can’t use this package as it will be External library.
Can anyone please let me know if we can use VB DOT Net or any direct code that can be invoked directly to extract .GZ file
GZ is the zipped file right.
Well my issue is resolved as I added the Bala Reva package and did refresh.
you can refresh or close the UiPath and reopen it and directly. Then you can search in Activity panel - Unzip activity.
As I see in your post - why you can’t use this package for Customer?
Hi Seema
Few of our customers deny use of external libraries due to security restrictions, therefore I am not able to use this package.
Otherwise this package works great.
Can in anycase a VB.net code be shared for the same unzipping package which can be directly invoked from Uipath Activity.
In UiPath we can do it as below:
declare a string variable ZipPath also another string variable - extractPath
Use assign activity,
string zipPath = @“c:\example\result.zip”; --path of ur Zipped file
Thanks a lot Seema for prompt reaponse.
But unfortunately in my process I am dealing with .GZ files.
for which I have C# sharp code ready. but I am unable to call it in my process.
Yes .zip and and .gZ is different, if you see in Uipath you will get system.io.compression.Zipfile and system.io.compression.GZstream
With .Zipfile ExtractToDirectory Method comes which is not the case with .GZStream.
As a solution to my problem, I customized a C# code to extract .GZ files in a specific folder.
C# Code:
using System;
using System.IO;
using System.IO.Compression;
namespace Unzipping
{
public class Program
{
public static void Main()
{
string directoryPath = @“<<<>>”;
DirectoryInfo directorySelected = new DirectoryInfo(directoryPath);
foreach (FileInfo fileToDecompress in directorySelected.GetFiles(“*.gz”))
{
Decompress(fileToDecompress);
}
}
public static void Decompress(FileInfo fileToDecompress)
{
using (FileStream originalFileStream = fileToDecompress.OpenRead())
{
string currentFileName = fileToDecompress.FullName;
string newFileName = currentFileName.Remove(currentFileName.Length - fileToDecompress.Extension.Length);
using (FileStream decompressedFileStream = File.Create(newFileName))
{
using (GZipStream decompressionStream = new GZipStream(originalFileStream, CompressionMode.Decompress))
{
decompressionStream.CopyTo(decompressedFileStream);
Console.WriteLine("Decompressed: {0}", fileToDecompress.Name);
}
}
}
}
}
}
Help Needed:
I need to convert this code to VB.Net to be utilized in my process.
Note: Converters for this task are available online but when I use converted code Uipath gives me Syntax error as below: