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"
}
]}
JSON Request content
{
"action": "rename",
"item": "/public_html/index.php",
"newItemPath": "/public_html/index2.php"
}
JSON Response
{ "result": { "success": true, "error": null } }
JSON Request content
{
"action": "move",
"items": ["/public_html/libs", "/public_html/config.php"],
"newPath": "/public_html/includes"
}
JSON Response
{ "result": { "success": true, "error": null } }
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 } }
JSON Request content
{
"action": "remove",
"items": ["/public_html/index.php"],
}
JSON Response
{ "result": { "success": true, "error": null } }
JSON Request content
{
"action": "edit",
"item": "/public_html/index.php",
"content": "<?php echo random(); ?>"
}
JSON Response
{ "result": { "success": true, "error": null } }
JSON Request content
{
"action": "getContent",
"item": "/public_html/index.php"
}
JSON Response
{ "result": "<?php echo random(); ?>" }
JSON Request content
{
"action": "createFolder",
"newPath": "/public_html/new-folder"
}
JSON Response
{ "result": { "success": true, "error": null } }
JSON Request content
{
"action": "changePermissions",
"items": ["/public_html/root", "/public_html/index.php"],
"perms": "rw-r-x-wx",
"permsCode": "653",
"recursive": true
}
JSON Response
{ "result": { "success": true, "error": null } }
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 } }
JSON Request content
{
"action": "extract",
"destination": "/public_html/extracted-files",
"item": "/public_html/compressed.zip",
"folderName": "extract_dir"
}
JSON Response
{ "result": { "success": true, "error": null } }
Http post request payload
------WebKitFormBoundaryqBnbHc6RKfXVAf9j
Content-Disposition: form-data; name="destination"
/
------WebKitFormBoundaryqBnbHc6RKfXVAf9j
Content-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)
Http query params
[fileManagerConfig.downloadFileUrl]?action=download&path=/public_html/image.jpg
Response
-File content
JSON Request content
{
"action": "downloadMultiple",
"items": ["/public_html/image1.jpg", "/public_html/image2.jpg"],
"toFilename": "multiple-items.zip"
}}
Response
-File content
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"
}}