博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
angular-filemanager API docs
阅读量:2810 次
发布时间:2019-05-13

本文共 4521 字,大约阅读时间需要 15 分钟。

https://github.com/joni2back/angular-filemanager/blob/master/API.md

angular-filemanager API docs [multiple file support]

Listing (URL: fileManagerConfig.listUrl, Method: POST)

JSON Request content

{    "action": "list",    "path": "/public_html"}

JSON Response

{ "result": [     {        "name": "magento",        "rights": "drwxr-xr-x",        "size": "4096",        "date": "2016-03-03 15:31:40",        "type": "dir"    }, {        "name": "index.php",        "rights": "-rw-r--r--",        "size": "549923",        "date": "2016-03-03 15:31:40",        "type": "file"    }]}

Rename (URL: fileManagerConfig.renameUrl, Method: POST)

JSON Request content

{    "action": "rename",    "item": "/public_html/index.php",    "newItemPath": "/public_html/index2.php"}

JSON Response

{ "result": { "success": true, "error": null } }

Move (URL: fileManagerConfig.moveUrl, Method: POST)

JSON Request content

{    "action": "move",    "items": ["/public_html/libs", "/public_html/config.php"],    "newPath": "/public_html/includes"}

JSON Response

{ "result": { "success": true, "error": null } }

Copy (URL: fileManagerConfig.copyUrl, Method: POST)

JSON Request content

{    "action": "copy",    "items": ["/public_html/index.php", "/public_html/config.php"],    "newPath": "/includes",    "singleFilename": "renamed.php" <-- (only present in single selection copy)}

JSON Response

{ "result": { "success": true, "error": null } }

Remove (URL: fileManagerConfig.removeUrl, Method: POST)

JSON Request content

{    "action": "remove",    "items": ["/public_html/index.php"],}

JSON Response

{ "result": { "success": true, "error": null } }

Edit file (URL: fileManagerConfig.editUrl, Method: POST)

JSON Request content

{    "action": "edit",    "item": "/public_html/index.php",    "content": "
"}

JSON Response

{ "result": { "success": true, "error": null } }

Get content of a file (URL: fileManagerConfig.getContentUrl, Method: POST)

JSON Request content

{    "action": "getContent",    "item": "/public_html/index.php"}

JSON Response

{ "result": "
" }

Create folder (URL: fileManagerConfig.createFolderUrl, Method: POST)

JSON Request content

{    "action": "createFolder",    "newPath": "/public_html/new-folder"}

JSON Response

{ "result": { "success": true, "error": null } }

Set permissions (URL: fileManagerConfig.permissionsUrl, Method: POST)

JSON Request content

{    "action": "changePermissions",    "items": ["/public_html/root", "/public_html/index.php"],    "perms": "653",    "permsCode": "rw-r-x-wx",    "recursive": true}

JSON Response

{ "result": { "success": true, "error": null } }

Compress file (URL: fileManagerConfig.compressUrl, Method: POST)

JSON Request content

{    "action": "compress",    "items": ["/public_html/photos", "/public_html/docs"],    "destination": "/public_html/backups",    "compressedFilename": "random-files.zip"}}

JSON Response

{ "result": { "success": true, "error": null } }

Extract file (URL: fileManagerConfig.extractUrl, Method: POST)

JSON Request content

{    "action": "extract",    "destination": "/public_html/extracted-files",    "item": "/public_html/compressed.zip"}

JSON Response

{ "result": { "success": true, "error": null } }

Upload file (URL: fileManagerConfig.uploadUrl, Method: POST, Content-Type: multipart/form-data)

Http post request payload

------WebKitFormBoundaryqBnbHc6RKfXVAf9jContent-Disposition: form-data; name="destination"/------WebKitFormBoundaryqBnbHc6RKfXVAf9jContent-Disposition: form-data; name="file-0"; filename="github.txt"Content-Type: text/plain

JSON Response

{ "result": { "success": true, "error": null } }

Unlimited file items to upload, each item will be enumerated as file-0, file-1, etc.

For example, you may retrieve the file in PHP using:

$destination = $_POST['destination'];$_FILES['file-0'] or foreach($_FILES)

Download / Preview file (URL: fileManagerConfig.downloadMultipleUrl, Method: GET)

Http query params

[fileManagerConfig.downloadFileUrl]?action=download&path=/public_html/image.jpg

Response

-File content

Download multiples files in ZIP/TAR (URL: fileManagerConfig.downloadFileUrl, Method: GET)

JSON Request content

{    "action": "downloadMultiple",    "items": ["/public_html/image1.jpg", "/public_html/image2.jpg"],    "toFilename": "multiple-items.zip"}}

Response

-File content

Errors / Exceptions

Any backend error should be with an error 500 HTTP code.

Btw, you can also report errors with a 200 response both using this json structure

{ "result": {    "success": false,    "error": "Access denied to remove file"}}

转载地址:http://vckhd.baihongyu.com/

你可能感兴趣的文章
16. 3Sum Closest (python)
查看>>
31. Next Permutation (python)
查看>>
Keras安装配置 windows版本
查看>>
keras安装配置centos版本
查看>>
Hadoop单机模式和伪分布式搭建教程CentOS
查看>>
线性时间排序:计数排序、基数排序、桶排序
查看>>
《TCP/IP详解卷一:协议》 概述
查看>>
设计一个有 getMin功能的栈
查看>>
《TCP/IP详解卷一:协议》数据链路层(一)
查看>>
《TCP/IP详解卷一:协议》数据链路层(二)
查看>>
顺序表查找
查看>>
有序表查找
查看>>
友盟分享和微信支付冲突解决方法
查看>>
Hive学习笔记 —— Hive的安装
查看>>
Hive学习笔记 —— Hive的管理
查看>>
LeetCode 39&40 Medium 组合数之和1/2 Python
查看>>
C语言进阶:第30课:C语言中的字符串
查看>>
C语言进阶:第31课:字符串典型问题分析
查看>>
C语言进阶:第32课:数组指针和指针数组分析
查看>>
C语言进阶:第33课、mian函数与命令行参数
查看>>