# FTP/SFTP

### FTPDumpTask

`FTPDumpTask` 用于从 FTP 下载数据文件，目前内置支持 CSV, Excel, JSONLines 格式的文件（支持 gzip 压缩），对于其他格式的文件需要定义 Python 函数进行处理。

#### Data Source

选择 FTP 配置

#### Absolute Filepath

需要下载的文件的绝对路径，支持模板变量，如 `/files/{{ ds.replace("-", "_") }}/data.csv`

#### Decompress

下载后是否要进行解压，None 表示不解压，Gzip 表示用 gzip 解压

#### File Format

（解压后的）文件格式，CSV, Excel, JSONLines(指每一行都是一个 JSON object 的文件) 有内置转换功能，其他格式需要定义 transform 转换成 CSV

#### Skip Header Lines

需要跳过的行数，使用场景如：下载了 Excel 文件，要跳过前 10 行表头，则设置为 10

#### Encoding（仅 CSV 格式需要）

文件编码，默认认为是 utf-8，如果填了其他编码，OneFlow 将会自动转换成 utf-8. 常见的使用场景是下载了 GBK 编码的 CSV 文件。

### CSV Delimiter（仅 CSV 格式需要）

CSV 分隔符，常见的有英文逗号（`,`）、制表符（），竖线（`|`）等

### CSV Line Terminator（仅 CSV 格式需要）

CSV 行结束符，Excel 导出的 CSV 通常是 `\r`.

### CSV Quoting（仅 CSV 格式需要）

CSV 字段的「包裹」机制，[参见 Python 文档](https://docs.python.org/3.6/library/csv.html#csv.QUOTE_ALL)，可选项

* `QUOTE_ALL`: 所有值都用双引号包裹
* `QUOTE_MINIMAL`: 只有需要的值被双引号包裹，如文本内含有分隔符
* `QUOTE_NONE`: 所有值都没有双引号
* `QUOTE_NONNUMERIC`: 非数值字段


---

# Agent Instructions: 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:

```
GET https://docs.reorc.com/cn-reorc-help-center/data-ingestion/lian-jie-yuan-lei-xing/ftp-sftp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
