Exists Check: CMD_FILE_MANAGER/some/file.txt?action=exists&json=yes

Version 1.533

Feature
Finished

New "action=exists" for CMD_FILEMANAGER and CMD_API_FILEMANAGER, and json, to determine if a file or directory exists. Sample call, pass via GET: CMD_FILE_MANAGER/.shadow?action=exists&json=yes where you can either use the url path, as above, or you can set the path, eg: CMD_FILE_MANAGER?path=/.shadow&action=exists&json=yes Sample return if it's a file: { "exists": "1", "result": "/.shadow", "success": "File exists check", "type": "file" } ---- CMD_FILE_MANAGER?path=/domains&action=exists&json=yes Sample if it's a directory: { "exists": "1", "result": "/domains", "success": "File exists check", "type": "directory" } ---- Does not exist: CMD_FILE_MANAGER?path=/blah&action=exists&json=yes { "exists": "0", "result": "/blah", "success": "File exists check" } and if there is an error: CMD_FILE_MANAGER?path=%3C%3E&action=exists&json=yes { "error": "Error check if file exists", "result": "Invalid path. Must also start with /\n" }

Interested to try DirectAdmin? Get a 30-day Free Trial!