> For the complete documentation index, see [llms.txt](https://docs.fractalworks.io/joule/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fractalworks.io/joule/components/connectors/sinks/custom-connectors/file.md).

# File

## Overview

The **File transport** enables direct writing of events to files in supported formats, ideal for archiving or further processing.

This setup is suitable for **long-term storage**, legacy system **integration** and **validation or testing** workflows.

With options for **various file formats, storage locations** and **batch settings**, this transport is adaptable to both local and cloud-based storage.&#x20;

## Example & DSL attributes

This example configures the **File transport** to save events as a CSV file named `nasdaqAnalytic.csv` in the directory `/home/app/data/output/analytics`.

Events are written in batches of 1024 records, with a 1000-millisecond timeout for each batch. The CSV file uses [UTF-8 encoding](https://en.wikipedia.org/wiki/UTF-8) and a pipe (`|`) as the delimiter.

```yaml
file:
  filename: nasdaqAnalytic
  path: /home/app/data/output/analytics
  batchSize: 1024
  timeout: 1000
  formatter:
    csvFormatter:
      contentType: text/csv
      encoding: UTF-8
      delimiter: "|"
```

### Attributes schema

<table><thead><tr><th width="150">Attribute</th><th width="173">Description</th><th width="288">Data Type</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>filename</td><td>file name to use</td><td><p>String</p><p></p></td><td>true</td></tr><tr><td>path</td><td>Absolute path files will be written too</td><td>String</td><td>true</td></tr><tr><td>maxFilesize</td><td>Maximum file size before new file is created</td><td><p>Long</p><p>Default: 67108864 (64MB)</p></td><td>false</td></tr><tr><td>batchSize</td><td>Number of events to trigger a file write process</td><td><p>Integer</p><p>Default: 1024</p></td><td>false</td></tr><tr><td>formatter</td><td>Target format of event data</td><td>See <a href="/pages/miyhMElxCDdwYCoBYMz6">Serialisation documentation</a></td><td>true</td></tr></tbody></table>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fractalworks.io/joule/components/connectors/sinks/custom-connectors/file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
