v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
Fileman
Manage Files

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.

get/Fileman/get_file_information

Query parameters

pathstring path required
Example:public_html

The directory from which to list files.

check_for_leaf_directories0 | 1
Example:1

Whether to flag directories that contain subdirectories.

  • 1 - Flag directories that contain subdirectories.
  • 0 - Do not flag directories that contain subdirectories.
include_mime0 | 1
Example:1

Whether to return the file's MIME type.

  • 1 - Return the file's MIME type.
  • 0 - Do not return the file's MIME type.
include_permissions0 | 1
Example:1

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.
show_hidden0 | 1
Example:1

Whether to include hidden files in the output.

  • 1 - Include hidden files.
  • 0 - Do not include hidden files.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "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,
      "humansize": "5 KB",
      "isleaf": 1,
      "mimename": "publichtml",
      "mimetype": "text/plain",
      "mode": "16872",
      "mtime": 1400573272,
      "nicemode": 755,
      "path": "/home/user/public.html",
      "rawmimename": "text/plain",
      "rawmimetype": "text/plain",
      "read": 1,
      "size": 4096,
      "type": "file",
      "uid": 502,
      "write": 1
    },
    "status": 1
  }
}