Path: API › 文件管理

`POST /files`

检查源文件是否与目标路径下已有文件重名，用于上传/复制前确认。

## Request body

_Required._

- `action117.request_time` (string, required) — Unix 时间戳。
- `action117.request_token` (string, required) — 按 API 概览生成的签名。
- `action117.action` (string, required) — 具体操作名称。
  - one of `"CheckExistsFiles"`
- `action117.dfile` (string, required) — 目标目录路径
- `action117.filename` (string, optional) — 要检查的单个文件名。不传则检查 session 中勾选的全部文件

## Example request

```text
{
  "request_time": "string",
  "request_token": "string",
  "action": "CheckExistsFiles",
  "dfile": "string",
  "filename": "string"
}
```

## Code samples

### cURL（填写面板地址与签名）

```curl
curl --request POST \
  --url "https://your-panel.example.com:8888/files" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "request_time=<Unix时间戳>" \
  --data-urlencode "request_token=<按 API 概览生成的签名>" \
  --data-urlencode "action=CheckExistsFiles" \
  --data-urlencode "dfile=<dfile>"
```

## Responses

### default

接口响应，业务状态见下方详细说明。

#### Example

```json
[]
```


## CheckExistsFiles

检查源文件是否与目标路径下已有文件重名，用于上传/复制前确认。

- **路由**：`POST /files`
- **action**：`CheckExistsFiles`

## 输入参数

| 参数名称 | 必选 | 类型 | 描述 |
|----------|------|------|------|
| action | 是 | String | 固定值 `CheckExistsFiles` |
| dfile | 是 | String | 目标目录路径 |
| filename | 否 | String | 要检查的单个文件名。不传则检查 session 中勾选的全部文件 |

## 输出参数

| 参数名称 | 类型 | 描述 |
|----------|------|------|
| - | Array | 已存在的文件名列表，空数组 `[]` 表示无冲突 |

## 示例

### 请求

```
POST /files HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded

action=CheckExistsFiles&dfile=/www/wwwroot&filename=index.html
```

### 响应

```json
[]
```

