Fileman
8 functions, invoked through the cpanel_uapi tool.
cpanel_uapi(service_id, module="Fileman", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.autocompletedir GET#
Return autocomplete file and directory names
This function returns any files and directories that begin with a specified string.
Important:
When you disable the File Storage role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
empty_trash GET#
Delete .trash folder content
This function purges content from the .trash folder in the user's home directory.
Important:
When you disable the FileStorage role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
Payload varies by call.
get_file_content GET#
Return file content
This function retrieves a file's content.
Important:
When you disable the File Storage role, the system disables this function.
Note:
JSON strings must be valid UTF-8. To retrieve a non-UTF-8 file via JSON, we recommend that you give ISO-8859-1 as from_charset and UTF-8 as to_charset, then decode the return payload’s content as UTF-8.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
get_file_information GET#
Return file or directory information
This function returns the information for a specified file or directory.
Important:
When you disable the File Storage role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
list_files GET#
Return directory content
This function returns a sorted list of files and directories.
Important:
When you disable the FileStorage role, the system disables this function. For more information, read our How to Use Server Profiles documentation.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
save_file_content GET#
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
transcode GET#
Update buffer encoding
This function converts a buffer from one encoding language to another.
Important:
When you disable the File Storage role, the system disables this function.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
upload_files GET#
Upload files
This function uploads files.
Note:
For more information about how to use this function in your custom code, read our Use UAPI's Fileman::upload_files Function in Custom Code tutorial.
Important:
When you disable the File Storage role, the system disables this function.
You cannot call this function through WHM API 1's uapi_cpanel function.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data contains: