Description
This function performs an operation on one or more files.
Warning:
We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
op |
string |
Required The operation. |
Extract the file.
|
move |
sourcefiles |
string |
Required The files. |
Any valid filename or directory name, relative to the account's /home directory. This parameter accepts multiple values as a comma-separated list. |
example.txt,example2.txt |
destfiles |
string |
The files to serve as the destination files for the source files. Note: Use this parameter if you used thecopy, move, or rename operations in the op parameter. |
Any valid filename or directory name on the server. This parameter accepts multiple values as a comma-separated list. |
new_directory |
doubledecode |
boolean |
Required Whether to decode the sourcefiles and destfiles parameters' URI values. |
|
1 |
metadata |
string |
The additional values that the op value's operation requires. For example, if you use the compressoperation, use this parameter to pass in the archive type. |
For the chmod operation, use this parameter to pass in the files' octal permissions:
For the compressoperation, use this parameter to pass in the files' octal permissions:
|
zip |
Returns
Return
|
Type
|
Description
|
Possible values
|
Example
|
---|---|---|---|---|
dest |
string | The path to the destination file. | The absolute path to a file on the server. |
/home/example/new_directory |
src |
string | The path from the source file. |
The absolute path to a location on the server. |
/home/example/example.txt |
output | string |
Additional relevant output. Note: This function only returns a |
A valid string. |
adding: new_directory (stored 0%) |
err |
string |
A reason for failure. Note: This function only returns a
|
A string that describes the error. | This is an error message. |
result |
boolean |
Whether the function succeeded. |
|
1 |