> For the complete documentation index, see [llms.txt](https://docs.appmixer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appmixer.com/connector-configuration/utils/ftp/list.md).

# List

### Overview

The **List Component** retrieves a list of files and directories from an FTP or SFTP server at a specified path, enabling workflows to manage and process remote files dynamically.

### Usage

This component connects to an FTP/SFTP server, lists the contents of a specified directory, and provides information about the files and folders.

#### Input Ports

| Port | Description                                                           |
| ---- | --------------------------------------------------------------------- |
| `in` | Receives the directory path for which the listing is to be retrieved. |

#### Output Ports

| Port  | Description                                                        |
| ----- | ------------------------------------------------------------------ |
| `out` | Emits the list of files and directories within the specified path. |

#### Properties

| Property | Type     | Description                                                   |
| -------- | -------- | ------------------------------------------------------------- |
| `path`   | `string` | The remote directory path for which the listing is requested. |

#### Processing Logic

1. **Establishes FTP/SFTP Connection**: Connects to the remote server using provided authentication.
2. **Lists Directory Contents**:
   * Checks if the specified path exists.
   * Retrieves details such as filenames, file types, and sizes.
3. **Handles Success & Errors**:
   * If successful, outputs the directory contents to the `out` port.
   * If the path is invalid or access is denied, an error is thrown.
4. **Closes Connection**: Ensures the connection is terminated after execution.

#### Output Data Schema

| Property  | Type    | Description                                                                                                                   |
| --------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `content` | `array` | A list of files and directories in the specified path. Each entry contains metadata such as name, type, size, and timestamps. |

### Notes

* **Supports FTP & SFTP**: Works with both FTP and secure FTP (SFTP) connections.
* **Efficient File Management**: Enables dynamic file and directory processing within workflows.
* **Error Handling**: Detects invalid paths and permission errors, sending appropriate error messages.

This component is essential for workflows that require automated remote file and directory listing.


---

# 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.appmixer.com/connector-configuration/utils/ftp/list.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.
