Skip to content

Get File Count

This operation returns the number of files and optionally directories located in the specified path. Additional options include:

  • pattern filtering - counts files and directories which match the pattern.
  • recursive counting - when enabled, counts all matching files and directories while recursively traversing the directory structure.





Argument                Description
<application id> ID of the application which can be obtained from the Manage > App Settings screen of the Backendless Console
<REST-api-key> REST API key of your application. You can get the value from the Manage > App Settings section of the Backendless Console.
<path> path of a directory to calculate the count for.
<pattern> an optional parameter. A pattern which the counted files and optionally directories (if the sub parameter is set to true) must match.
<sub> an optional parameter. A boolean value of true or false. If present and is true, requests that the count must recursively include all directories contained within <path>.
<countDirectories> an optional parameter. A boolean value of true or false. If present and is true, directories should be included into the count.

Request headers

user-token: optional value obtained as a result of the login operation.


Argument                Description
user-token Optional header. Contains a value returned by Backendless in a preceding user Login API call. If user-token is set in the request, the currently logged in user will be assigned to the ownerId property of the user object which is being saved.  Additionally, the operation will be executed with the security policy associated currently logged in user. This means all permissions associated with the user and the roles assigned to the user will be enforced by Backendless.

Request Body:



Argument                Description
path path of a directory in the Backendless files storage starting with /
pattern a glob pattern to match files which should be counted.
recursive if set to true, recursively count matching files in all subdirectories.
countDirectories if set to true, count directories in addition to files.


Get a count of files matching the *.html pattern in the /web directory:


Get a count of *.jpg files in the /images directory recursively :