Return file or directory information

This function returns the information for a specified file or directory.

Important:

When you disable the File Storage role, the system disables this function.

SecurityBasicAuth
Request
query Parameters
path
required
string <path>

The directory from which to list files.

Example: path=public_html
check_for_leaf_directories
integer
Default: 0

Whether to flag directories that contain subdirectories.

  • 1 - Flag directories that contain subdirectories.
  • 0 - Do not flag directories that contain subdirectories.
Enum: 0 1
Example: check_for_leaf_directories=1
include_hash
integer
Default: 0

Whether to return a hash of the file's information.

  • 1 - Return a hash of the file's information.
  • 0 - Do not return a hash of the file's information.
Enum: 0 1
Example: include_hash=0
include_mime
integer
Default: 0

Whether to return the file's MIME type.

  • 1 - Return the file's MIME type.
  • 0 - Do not return the file's MIME type.
Enum: 0 1
Example: include_mime=1
include_permissions
integer
Default: 0

Whether to parse the file owner's read and write permissions.

  • 1 - Parse the file owner's read and write permissions.
  • 0 - Do not parse the file owner's read and write permissions.
Enum: 0 1
Example: include_permissions=1
show_hidden
integer
Default: 0

Whether to include hidden files in the output.

  • 1 - Include hidden files.
  • 0 - Do not include hidden files.
Enum: 0 1
Example: show_hidden=1
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/Fileman/get_file_information
Request samples
uapi --output=jsonpretty \
  --user=username \
  Fileman \
  get_file_information \
  path='public_html'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "get_file_information",
  • "module": "Fileman",
  • "result": {
    • "data": {
      • "absdir": "/home/user",
      • "ctime": 1400573272,
      • "exists": 1,
      • "file": "cgi-bin",
      • "fullpath": "/home/user/public_html/cgi-bin",
      • "gid": 503,
      • "hash": "L2hvbWUvY29saW4vcHVibGljX2h0bWw",
      • "humansize": "5 KB",
      • "isleaf": 1,
      • "mimename": "publichtml",
      • "mimetype": "text/plain",
      • "mode": "16872",
      • "mtime": 1400573272,
      • "nicemode": 755,
      • "path": "/home/user/public.html",
      • "phash": "L2hvbWUvY29saW4vcHVibGljX2h0bWw",
      • "rawmimename": "text/plain",
      • "rawmimetype": "text/plain",
      • "read": 1,
      • "size": 4096,
      • "type": "file",
      • "uid": 502,
      • "write": 1
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}