跳到正文
Navigation

读取文件内容(用于在线编辑)

POST
https://your-panel.example.com:8888/files

读取或保存文件内容,用于面板在线编辑器。

Request body application/x-www-form-urlencoded required

  • request_time
    string
    required

    Unix 时间戳。

  • request_token
    string
    required

    按 API 概览生成的签名。

Returns

default

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

JSON
  • status
    optional
    boolean

    true

  • data
    optional
    string

    文件内容

  • encoding
    optional
    string

    检测到的编码(如 utf-8)

  • size
    optional
    integer

    文件大小(字节)

  • only_read
    optional
    boolean

    是否只读

各操作详细说明

GetFileBody读取文件内容(用于在线编辑)

GetFileBody / SaveFileBody

读取或保存文件内容,用于面板在线编辑器。

  • 路由:POST /files

GetFileBody

读取文件内容,自动检测编码。

参数名称 必选 类型 描述
action 是 String GetFileBody
path 是 String 文件路径

输出参数

参数名称 类型 描述
status Boolean true
data String 文件内容
encoding String 检测到的编码(如 utf-8)
size Integer 文件大小(字节)
only_read Boolean 是否只读

示例

{"status": true, "only_read": false, "size": 917, "encoding": "utf-8", "data": "<!doctype html>..."}

SaveFileBody

保存编辑后的内容到文件。

参数名称 必选 类型 描述
action 是 String SaveFileBody
path 是 String 文件路径(必须已存在)
data 是 String 新内容
encoding 是 String 编码,如 utf-8

文件必须已存在且面板有写入权限。

Type to search…

↑↓ navigate↵ selectEsc close