Description
This function retrieves a file's content.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameters |
Type |
Description |
Possible values |
Example |
dir |
string |
Required The file path to the directory that contains the selected file. |
The absolute path to the directory. |
/home/user/public.html |
file |
string |
Required The files to retrieve. |
A valid filename. |
example.html |
from_charset |
string |
The system's predefined encoding. |
|
_DETECT_
|
to_charset |
string |
The character set in which to encode the file. |
|
_LOCALE_
|
Returns
Return |
Type |
Description |
Possible values |
Example |
dir |
string |
The file path to the directory that contains the selected file. |
A valid absolute path. |
/home/user/public_html |
filename |
string |
The file's name. |
A valid filename. |
example.html |
path |
string |
The path to the file. |
A valid absolute path. |
/home/user/public_html/example.html |
content |
string |
The file's contents, encoded in theUTF-8 character set. |
A string value. |
"hi" |
from_char |
string |
The file's character set. |
A cPanel-supported character set encoding.
|
UTF-8 |
to_char |
string |
The file's new character set. |
A cPanel-supported character set encoding.
|
UTF-8 |