# Return file content This function retrieves a file's content. When you disable the File Storage role, the system this function. JSON strings be valid UTF-8. To retrieve a non-UTF-8 file via JSON, we recommend that you give as and as , then decode the return payload’s as UTF-8. Endpoint: GET /Fileman/get_file_content Version: 11.134.0.5 Security: BasicAuth ## Query parameters: - `dir` (string, required) The file path to the directory that contains the selected file. Example: "/home/user/public.html" - `file` (string, required) The file to retrieve. Example: "example.html" - `from_charset` (string) The file’s character encoding. This parameter defaults to , which indicates a request to detect the file’s character encoding. Example: "_DETECT_" - `to_charset` (string) The output character encoding. This parameter defaults to , which indicates a request to use the session locale’s character encoding. Contexts that serialize the API response as JSON this value to be or . Behavior is if the request indicates any other encoding. Example: "_LOCALE_" - `update_html_document_encoding` (integer) Whether to update the file's HTML document encoding. * — Update the file's HTML document encoding. * — Don't update the file's HTML encoding. Enum: 0, 1 ## Response 200 fields (application/json): - `apiversion` (integer) The version of the API. Example: 3 - `func` (string) The name of the method called. Example: "get_file_content" - `module` (string) The name of the module called. Example: "Fileman" - `result` (object) - `result.data` (object) - `result.data.content` (string) The file's contents. A string value. Behavior is if the calling context requires an encoding that conflicts with the file contents. For example, if the file contents are ISO-8859-1 but the context requires UTF-8 (as is the case with JSON), the system may apply an extra layer of UTF-8 encoding in order to satisfy the request. Example: "`hi`" - `result.data.dir` (string) The absolute path to the directory that contains the selected file. Example: "/home/user/public_html" - `result.data.filename` (string) The file's name. Example: "example.html" - `result.data.from_char` (string) The file's previous character encoding. If the request’s was , this will contain the detected encoding. Otherwise, it will contain the request’s value. Example: "UTF-8" - `result.data.from_charset` (any) - `result.data.path` (string) The absolute path to the file. Example: "/home/user/public_html/example.html" - `result.data.to_char` (string) The file's new character encoding. If the request’s was , this will contain the locale’s encoding. Otherwise, it will contain the request’s value. Example: "UTF-8" - `result.data.to_charset` (any) - `result.errors` (array,null) List of errors if the API failed. - `result.messages` (array,null) List of messages generated by the API. - `result.metadata` (object) - `result.status` (integer) - 1 - Success - 0 - Failed: Check the errors field for more details. Enum: 0, 1 - `result.warnings` (array,null) List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.