Fileman
Manage Files

Rename a file

This function changes the name of a file or directory within the same directory. To move a file to a different directory, use the move_file function. The function returns an error if the destination already exists.

Important:

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

get/Fileman/rename_file

Request

  • Base URL
    https://cpanel-server.tld:2083/execute
  • Auth
    HTTP basic

Query parameters

destinationstring path required
Example:public_html/new.txt

The new path, in the same directory as the source.

sourcestring path required
Example:public_html/old.txt

The path to the file or directory to rename.

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": "rename_file",
  "module": "Fileman",
  "result": {
    "status": 1
  }
}

Changes

No recorded changes to this operation across all 5 revisions of this API.