Description
This function lists possible file actions.
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 |
dir |
string |
Required The base directory's path. |
A valid absolute directory path. |
/home/user |
file |
string |
Required The file or directory to search. |
Any valid filename or directory name on the server. |
public_html |
newedit |
Boolean |
Whether to return URLs and targets for thefile or editor parameter's values. This parameter defaults to 0. |
|
1 |
Returns
Return |
Type |
Description |
Possible values |
Example |
actions |
hash |
A hash of action options. |
This hash contains theactionname,target,actionurl, andaction returns. |
|
actionname |
string |
The action to perform on the file or directory. The function returns this value in the actions hash. |
A valid string. |
Show File Contents |
target |
string |
The action's target. The function returns this value in the actions hash. |
|
viewer |
actionurl |
string |
The URL fragment to append to a File Manager URL. The function returns this value in the actions hash. |
A URL fragment. |
showfile.html?dir=%2fhome%2fexample&file |
action |
string |
The action for the file or directory. The function returns this value in the actions hash. |
A valid string. |
showcontents |
file |
string |
The file that the function queried. |
A valid filename. |
public_html |
fileinfo |
string |
A description of file. |
A string that describes any additional information about the file. |
Contains 5 items. |
mimename |
string |
The file's MIME name. |
A valid MIME type. |
homeb |
mimetype |
string |
The file's MIME type. |
A valid MIME type. |
homeb |
dir |
string |
The directory that the function queried. |
An absolute file path. |
/home/user |
reason |
string |
A reason for failure Note: This function only returns a reasonvalue if there was an error. |
A string that describes the error. |
This is an error message. |
result |
Boolean |
Whether the function succeeded. |
|
1 |