# Zip operations

### Add folder to zip file <a href="#add-folder-to-zip-file" id="add-folder-to-zip-file"></a>

Zips all files and subfolders in a folder into a zip file.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter         | Description                                                                                                                                |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Path              | Path to read files and folders from.                                                                                                       |
| Path to zip file  | Zip file to add folder content to.                                                                                                         |
| Password          | Optional password to the zip file.                                                                                                         |
| Replace mode      | Specifies what to do if a specific file already exists in the archive.                                                                     |
| Compression level | Specifies the level of compression, valid values are 1-9 where 9 indicates highest level of compression (and slowest). Default value is 6. |

#### Output <a href="#output" id="output"></a>

Simple value, 'True' if operation was successfully. 'False' otherwise.

#### Since <a href="#since" id="since"></a>

6.3

### Add single file to zip <a href="#add-single-file-to-zip" id="add-single-file-to-zip"></a>

Compresses a single file and adds it to a zip file.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter         | Description                                                                                                                                |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| File              | File to add to archive.                                                                                                                    |
| Path to zip file  | Zip file to add file to.                                                                                                                   |
| Password          | Optional password to the zip file.                                                                                                         |
| Replace mode      | Specifies what to do if a specific file already exists in the archive.                                                                     |
| Compression level | Specifies the level of compression, valid values are 1-9 where 9 indicates highest level of compression (and slowest). Default value is 6. |

#### Output <a href="#output" id="output"></a>

Simple value, 'True' if operation was successfully. 'False' otherwise.

#### Since <a href="#since" id="since"></a>

6.3

### Add stream to zip <a href="#add-stream-to-zip" id="add-stream-to-zip"></a>

Compresses the content of a Flow variable that contains a binary stream. This can for instance be used to compress data from a camera input.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter                       | Description                                                                                                                                |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Stream                          | Stream to read data from.                                                                                                                  |
| Filename for stream in zip file | The name of the file in the archive the content of the stream should be written to.                                                        |
| Path to zip file                | Zip file to add stream content to.                                                                                                         |
| Password                        | Optional password to the zip file.                                                                                                         |
| Replace mode                    | Specifies what to do if a specific file already exists in the archive.                                                                     |
| Compression level               | Specifies the level of compression, valid values are 1-9 where 9 indicates highest level of compression (and slowest). Default value is 6. |

#### Output <a href="#output" id="output"></a>

Simple value, 'True' if operation was successfully. 'False' otherwise.

#### Since <a href="#since" id="since"></a>

6.3

### Extract file to stream <a href="#extract-file-to-stream" id="extract-file-to-stream"></a>

Extracts a single file to a stream. The entire file will be loaded into memory, so do not use this operation with large files.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter        | Description                                     |
| ---------------- | ----------------------------------------------- |
| Path to zip file | Zip file to extract from.                       |
| Filename         | The name of the file in the archive to extract. |
| Password         | Optional password to the zip file.              |

#### Output <a href="#output" id="output"></a>

Simple value, read-only binary stream trinket.

#### Since <a href="#since" id="since"></a>

6.3

### Extract files from zip <a href="#extract-files-from-zip" id="extract-files-from-zip"></a>

Extracts all files from a zip file which matches provided mask.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter        | Description                                                                                                                                                                           |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Path to zip file | Zip file to extract from.                                                                                                                                                             |
| Destination path | Path where to extract files to. If file or directory already exists at destination path, it is skipped (not overwritten). The directory should exist before this operation is called. |
| Filter           | Filet to use when filtering items in archive. Example "\*.txt".                                                                                                                       |
| Password         | Optional password to the zip file.                                                                                                                                                    |

#### Output <a href="#output" id="output"></a>

Simple value, 'True' if operation was successfully. 'False' otherwise.

#### Since <a href="#since" id="since"></a>

6.3
