# FTP设置

## 入门指南

在这个章节中，您将能够管理您的FTP连接设置以及从FTP服务器中检索或[*获取*](#user-content-fn-1)[^1]的文件。

1. [设置一个主动FTP连接](#setting-up-your-ftp-connection-settings)
2. [定义应从FTP中检索的文件](#define-the-filenames)
3. [获取文件](#fetch-files-from-ftp)以进行数据导入
4. [查看FTP导入活动](#ftp-data-import-activities)

## 配置FTP连接设置

1. 转到**导入**页面
2. 在导航选项卡中，点击\*\*'FTP设置'\*\*

<figure><img src="https://github.com/QualityTrade/iaf-docs-certification-bodies-zh/blob/main/.gitbook/assets/[FTP]-tab%20(1).png" alt=""><figcaption></figcaption></figure>

3. 点击\*\*'编辑'\*\*按钮

<figure><img src="https://github.com/QualityTrade/iaf-docs-certification-bodies-zh/blob/main/.gitbook/assets/[FTP]-filename-card.png" alt="" width="563"><figcaption><p>FTP连接设置</p></figcaption></figure>

* FTP访问状态
  * <mark style="color:green;">**激活**</mark>，*持续从FTP中提取/下载文件*
  * <mark style="color:red;">**停止**</mark>，*停止从FTP中提取/下载文件*
* FTP服务器协议
  * **FTP**，*依赖用户名和密码进行身份验证*
  * **SFTP**，*使用SSH密钥进行身份验证，更加安全*

<figure><img src="https://github.com/QualityTrade/iaf-docs-certification-bodies-zh/blob/main/.gitbook/assets/[FTP]-protocol.png" alt="" width="375"><figcaption><p>选择协议</p></figcaption></figure>

* 服务器主机
* 服务器端口
* 服务器用户名
* 服务器密码
  * 如果选择了**SFTP**，请添加**私钥**

4. 要检查FTP是否成功连接，请点击‘**测试FTP连接**’按钮。
5. 一旦FTP连接成功，请点击\*\*‘保存更改’\*\*按钮。

完成FTP连接设置后，下一步是添加您希望从FTP服务器中检索或获取的文件。

***

## 定义文件名

定义文件名是必需的，这样IAF CertSearch才能将您的数据从服务器检索到IAF CertSearch数据库中。

{% hint style="info" %}
**前提条件**

在定义文件名之前，请确保您已将包含您的格式化数据的文件[上传](/certification-bodies/cb-zh/data-management/data-import/certification-templates.md)到FTP服务器上。
{% endhint %}

1. 在FTP设置页面，转到**FTP文件名**部分

   <figure><img src="https://github.com/QualityTrade/iaf-docs-certification-bodies-zh/blob/main/.gitbook/assets/[FTP]-filename-card%20(2).png" alt=""><figcaption></figcaption></figure>
2. 点击\*\*‘添加FTP文件名’\*\*按钮
3. 在‘添加FTP文件名’对话框中，添加您想要检索的文件名。

{% hint style="warning" %}
请确保您的文件名与上传到服务器上的文件名匹配。
{% endhint %}

<figure><img src="https://github.com/QualityTrade/iaf-docs-certification-bodies-zh/blob/main/.gitbook/assets/[FTP]-filename-card%20(2).png" alt=""><figcaption></figcaption></figure>

* 文件名支持的字符包括：
  * 字母数字字符：A-z，a-z，0-9
  * 破折号(-)
  * 下划线(\_)
  * 空格( )
  * 正斜杠，用于支持子文件夹(/)
  * *例如：* `cb_certs_1.xlm`，`cb_certs_2.xlsx`

4. 如果要添加多个文件名，请点击‘**+添加FTP文件名**’按钮
5. 完成后，点击\*\*‘提交’\*\*按钮

***

## 从FTP中获取文件

一旦文件被定义，您可以选择：

* **立即获取文件**，通过手动点击\*\*‘获取文件’\*\*按钮完成
* **在FTP爬行计划期间获取文件**，计划每天从**UTC 01:00 am**开始。

#### 规则

* <mark style="color:red;">对文件进行的任何更改将在每24小时更新一次。</mark>
* <mark style="color:red;">如果文件名不匹配，系统将不会上传文件。</mark>
* <mark style="color:red;">如果FTP文件名部分中没有文件名，将跳过获取文件操作。</mark>

***

## FTP数据导入活动

允许您查看所有FTP导入活动。

***

[^1]: 从FTP服务器中检索或下载文件的过程


---

# 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://support.iafcertsearch.org/certification-bodies/cb-zh/data-management/data-import/ftp-settings.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.
