JSON Request content
{ "params": {
"mode": "list",
"onlyFolders": false,
"path": "/public_html"
}}
JSON Response
{ "result": [
{
"name": "joomla",
"rights": "drwxr-xr-x",
"size": "4096",
"date": "2015-04-29 09:04:24",
"type": "dir"
}, {
"name": "magento",
"rights": "drwxr-xr-x",
"size": "4096",
"date": "17:42",
"type": "dir"
}, {
"name": "index.php",
"rights": "-rw-r--r--",
"size": "549923",
"date": "2013-11-01 11:44:13",
"type": "file"
}
]}
JSON Request content
{ "params": {
"mode": "rename",
"path": "/public_html/index.php",
"newPath": "/public_html/index2.php"
}}
JSON Response
{ "result": { "success": true, "error": null } }
JSON Request content
{ "params": {
"mode": "copy",
"path": "/public_html/index.php",
"newPath": "/public_html/index-copy.php"
}}
JSON Response
{ "result": { "success": true, "error": null } }
JSON Request content
{ "params": {
"mode": "delete",
"path": "/public_html/index.php",
}}
JSON Response
{ "result": { "success": true, "error": null } }
JSON Request content
{ "params": {
"mode": "savefile",
"content": "<?php echo random(); ?>",
"path": "/public_html/index.php",
}}
JSON Response
{ "result": { "success": true, "error": null } }
JSON Request content
{ "params": {
"mode": "editfile",
"path": "/public_html/index.php"
}}
JSON Response
{ "result": "<?php echo random(); ?>" }
JSON Request content
{ "params": {
"mode": "addfolder",
"name": "new-folder",
"path": "/public_html"
}}
JSON Response
{ "result": { "success": true, "error": null } }
JSON Request content
{ "params": {
"mode": "changepermissions",
"path": "/public_html/index.php",
"perms": "653",
"permsCode": "rw-r-x-wx",
"recursive": false
}}
JSON Response
{ "result": { "success": true, "error": null } }
JSON Request content
{ "params": {
"mode": "compress",
"path": "/public_html/compressed.zip",
"destination": "/public_html/backups"
}}
JSON Response
{ "result": { "success": true, "error": null } }
JSON Request content
{ "params": {
"mode": "extract",
"destination": "/public_html/extracted-files",
"path": "/public_html/compressed.zip",
"sourceFile": "/public_html/compressed.zip"
}}
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]?mode=download&preview=true&path=/public_html/image.jpg
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"
}}