read
Last updated
Last updated
Reads an existing file in the cache directory of the mobile phone and returns its content.
Name | Description | Input Type | Default | Options | Required |
---|---|---|---|---|---|
Description | Output Type |
---|---|
Key | Description | Output Type |
---|---|---|
The action performed if this function runs successfully.
The action performed if this function does not run successfully.
In this example, we will read the file content.
Drag a button component to a page in the mobile designer.
Select the event press
and drag the File.read
function to the event flow and fill in the parameter.
Open the installed app on a device with a debugger on and try to press the button.
If the file exists, user should be able to see the content on the console.
Description | Output Type |
---|---|
Description | Output Type |
---|---|
fileName
The name of the file to read.
Text
-
-
Yes
folder
The folder path of the file. If this input is provided, it will be appended to the storage path.
Text
-
-
No
dataType
The type of data to return.
Text
-
Base64, Text, Byte_Array
Yes
extra
The stored value that is passed to all the callbacks.
Any
-
-
No
Returns the formatted information.
Object
success
Boolean value to denote whether the function was executed successfully.
Text
message
The message to print.
Text
data
Any additional message or data to print.
Text
Returns the file content based on the user's choice of data type.
Any
Returns an error message.
Text