v1

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

Move a file

This function moves a file or directory to a new location. If the destination is an existing directory, the source is moved into it. 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/move_file

Query parameters

destinationstring path required
Example:public_html/subdir/new.txt

The path to move the source to.

sourcestring path required
Example:public_html/old.txt

The path to the file or directory to move.

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": "move_file",
  "module": "Fileman",
  "result": {
    "data": {
      "src": "/home/user/public_html/old.txt",
      "dest": "/home/user/public_html/subdir/new.txt"
    },
    "status": 1
  }
}