Skip to content

检测路径是否存在,返回路径类型信息

检测指定路径是否存在,返回路径、类型(目录/文件)和存在状态。

POST
https://your-panel.example.com:8888/files
更新于 查看 Markdown

Request bodyX-WWW-FORM-URLENCODEDrequired

  • request_timestringrequired

    Unix 时间戳。

  • request_tokenstringrequired

    按 API 概览生成的签名。

  • actiontest_pathrequired

    具体操作名称。

  • pathstringrequired

    要检测的路径

Returns

default

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

JSON
  • pathoptionalstring

    路径

  • is_diroptionalboolean

    true 为目录,false 为文件,null 为不存在

  • existsoptionalboolean

    路径是否存在

各操作详细说明

test_pathaction=test_path检测路径是否存在,返回路径类型信息

检测指定路径是否存在,返回路径、类型(目录/文件)和存在状态。

  • 路由:POST /files
  • action:test_path

输入参数

参数名称 必选 类型 描述
action 是 String 固定值 test_path
path 是 String 要检测的路径

输出参数

参数名称 类型 描述
path String 路径
is_dir Boolean true 为目录,false 为文件,null 为不存在
exists Boolean 路径是否存在

示例

请求

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

action=test_path&path=/www/wwwroot

响应

{"path": "/www/wwwroot", "is_dir": true, "exists": true}
Navigation

Type to search…

↑↓ navigate↵ selectEsc close