# CompressZipFiles

> Adds the specified files or folders to a compressed (zip) file archive.

Adds the specified files or folders to a compressed (zip) file archive.

## Definition

**Namespace:** UiPath.Activities.System.API

**Assembly:** UiPath.System.Activities.Api (in UiPath.System.Activities.Api.dll)

## Overloads

|  |  |
| --- | --- |
| `CompressZipFiles(IEnumerable<IResource>, String)` | Adds the specified files or folders to a compressed (zip) file archive. |
| `CompressZipFiles(IEnumerable<IResource>, String, String, ArchiveCompressionLevel, CodePages, Boolean)` | Adds the specified files or folders to a compressed (zip) file archive, along with advanced configurations of the file. |

## `CompressZipFiles(IEnumerable<IResource>, String)`

Adds the specified files or folders to a compressed (zip) file archive.

```
ILocalResource CompressZipFiles(
    IEnumerable<IResource> resourcesToArchive,
    string compressedFileName
)
```

`resourcesToArchive` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) `IResource` : Specifies the files to be compressed.

`compressedFileName` [String](https://learn.microsoft.com/dotnet/api/system.string) : Name of the compressed file to create.

## `CompressZipFiles(IEnumerable<IResource>, String, String, ArchiveCompressionLevel, CodePages, Boolean)`

Adds the specified files or folders to a compressed (zip) file archive, along with advanced configurations of the file.

```
ILocalResource CompressZipFiles(
    IEnumerable<IResource> resourcesToArchive,
    string compressedFileName,
    string password,
    ArchiveCompressionLevel compressionLevel,
    CodePages codePage,
    bool overrideExistingFile
)
```

`resourcesToArchive` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) `IResource` : Specifies the files to be compressed.

`compressedFileName` [String](https://learn.microsoft.com/dotnet/api/system.string) : Name of the compressed file to create.

`password` [String](https://learn.microsoft.com/dotnet/api/system.string) : Require the specified password to open the file.

`compressionLevel ArchiveCompressionLevel` : How small to compress the file. The higher the compression level the slower it is to compress and decompress.

`codePage CodePages` : Text encoding for file names. You can use **System default** or **Unicode (UTF-8)**.

`overrideExistingFile` [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) : Replace compressed file if it already exists.

## Return value

`ILocalResource`

Reference to the created file.
