> For the complete documentation index, see [llms.txt](https://boxlang.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boxlang.ortusbooks.com/boxlang-language/reference/components/zip/zipparam.md).

# ZipParam

Adds a param to a zip component.

## Component Signature

```
<bx:ZipParam charset=[string]
content=[any]
entryPath=[string]
filter=[any]
filterDelimiters=[string]
prefix=[string]
source=[string]
recurse=[boolean]
password=[string]
encryptionAlgorithm=[string] />
```

### Attributes

| Atrribute             | Type      | Required | Description                                                                                                              | Default |
| --------------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------ | ------- |
| `charset`             | `string`  | `false`  | The charset to use for the content of the Zip entry - used only when the content attribute is provided with text content |         |
| `content`             | `any`     | `false`  | The content of the Zip entry - can be binary or text content                                                             |         |
| `entryPath`           | `string`  | `false`  | The path of the Zip entry - required if content is specified                                                             |         |
| `filter`              | `any`     | `false`  | The filter to apply to the content of the Zip entry - applies for source directories                                     |         |
| `filterDelimiters`    | `string`  | `false`  | The delimiters to use for the filter - not implemented in the current release                                            |         |
| `prefix`              | `string`  | `false`  | The prefix to use for the created zip entries                                                                            |         |
| `source`              | `string`  | `false`  | The source of the Zip entry - either a file or a directory                                                               |         |
| `recurse`             | `boolean` | `false`  | Whether to recurse into subdirectories when zipping                                                                      | `true`  |
| `password`            | `string`  | `false`  | The password to use for the Zip entry - not implemented in the current release                                           |         |
| `encryptionAlgorithm` | `string`  | `false`  | The encryption algorithm to use for the Zip entry - not implemented in the current release                               |         |

## Examples

### Add a file to a ZIP archive

Defines a source file or directory to include in a ZIP operation.

```java
<bx:zip action="zip" file="/tmp/archive.zip" source="/tmp/myfile.txt">

```

### Add a directory recursively

```java
<bx:zip action="zip" file="/tmp/archive.zip" source="/tmp/myfolder" recurse="true">

```

### Add content directly as a ZIP entry

Creates a ZIP entry from in-memory content without a source file.

```java
<bx:zip action="zip" file="/tmp/archive.zip">
    <bx:zipParam content="Hello World" entryPath="greeting.txt">
</bx:zip>

```

### Add content with a specific charset

```java
<bx:zip action="zip" file="/tmp/archive.zip">
    <bx:zipParam content="Bonjour le monde" entryPath="french.txt" charset="UTF-8">
</bx:zip>

```

### Filter files when zipping a directory

```java
<bx:zip action="zip" file="/tmp/archive.zip" source="/tmp/logs">
    <bx:zipParam filter="*.log">
</bx:zip>

```

### Add a prefix to ZIP entry paths

```java
<bx:zip action="zip" file="/tmp/archive.zip" source="/tmp/data">
    <bx:zipParam prefix="backup/2024/">
</bx:zip>

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/components/zip/zipparam.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
