mutil_unzip
批量解压多个压缩文件到指定目录,支持 zip/tar.gz 等格式。
- 路由:
POST /files - action:
mutil_unzip
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 mutil_unzip |
| sfile_list | 是 | String | JSON 数组,要解压的文件路径列表 |
| dfile | 是 | String | 解压目标目录 |
| coding | 是 | String | 编码,如 utf-8 |
| type1 | 是 | String | 压缩类型:zip / tar / gz 等 |
输出参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| status | Boolean | true 全部解压成功 |
| msg | String | 结果消息 |
| success | Array | 成功的文件列表 |
| fail | Array | 失败的文件列表 |
示例
请求
POST /files HTTP/1.1
Host: 192.168.168.213:8888
Content-Type: application/x-www-form-urlencoded
action=mutil_unzip&sfile_list=["/tmp/test.zip"]&dfile=/tmp/extract&coding=utf-8&type1=zip
响应
{"status": true, "msg": "全部解压完成!", "success": [], "fail": []}