v1

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

Copy a file

This function copies a file or directory to a new location and preserves the source permissions and modification time. If the destination is an existing directory, the source is copied 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/copy_file

Query parameters

destinationstring path required
Example:public_html/backup/file.txt

The path to copy the source to.

sourcestring path required
Example:public_html/file.txt

The path to the file or directory to copy.

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