> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/react-native/device/choosefile.md).

# chooseFile

## Description

Selects an image or file from the device’s storage.

## Input / Parameter

| Name     | Description                              | Input Type | Default | Options             | Required |
| -------- | ---------------------------------------- | ---------- | ------- | ------------------- | -------- |
| type     | Type of file to choose.                  | Text       | -       | Image, Other\_Files | Yes      |
| multiple | Whether to select multiple files or not. | Boolean    | false   | true, false         | No       |

## Output

| Description                        | Output Type |
| ---------------------------------- | ----------- |
| Returns the formatted information. | Object      |

## Callback

### callback

The functions to be executed if file is chosen successfully.

| Description                          | Output Type |
| ------------------------------------ | ----------- |
| The information of the chosen files. | Object      |

Object format.

```
    {
        "extra": undefined,
        "input": [
            {
            "fileCopyUri": null,
            "name": "text.txt",
            "size": 4,
            "type": "text/plain",
            "uri": "file:///data/user/0/com.firstproject/cache/text.txt"
            }
        ]
    }
```

### errorCallback

The functions to be executed if the file is not chosen.

| Description        | Output Type |
| ------------------ | ----------- |
| The error message. | Text        |

## Example

In this example, we will use the `Device.chooseFile` function to get some files data and show it on the console.

### Step

1. Call the function `Device.chooseFile` inside the eventflow, and for it's `type` param select value `Image` and for it's `multiple` param select value `true`.

   ![](/files/n5C7qJQjq7FlYbswelMW)
2. Call the function `Log.write` inside the `Device.chooseFile` function callback, and for it's `value` param change the param type to `input`.

   ![](/files/yfoIdVYNXKMvjaa7KzMY)

### Result

1. Trigger the event.

   ![](/files/2mZqHliXVh4ND3wNyC49)
2. Select the images.

   ![](/files/KjQetmJ6mT04evarZmyA)
3. Check the console.

   ![](/files/WmnlSJb8gLxhEssir9y2)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/react-native/device/choosefile.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
