# Upload a File

This is pre-built Action located under the **@Custom Element.** The functionality of this action in Avo Assure to upload a file on the object specified in the input by providing the file path from the local system, and save the result in dynamic variable.

### **Syntax:** &#x20;

**Input Value:** `<Object Type >;<Visible Text(Optional)>;<index>;<file path>;< file name><wait(in second)>;<abs (optional)>`&#x20;

| Argument                                     | Description                                                                                                    |
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| <p>\<ObjectType><br>(Required)</p>           | Specify the type of object (e.g., Button)                                                                      |
| <p>\<VisibleText><br>(Optional)</p>          | Enter the visible text on the object                                                                           |
| <p>\<Index><br>(Required)</p>                | Provide the index of the object inside the page                                                                |
| <p>\<FilePath><br>(Required)</p>             | Path to the folder containing the file to upload                                                               |
| <p>\<FileName><br>(Required)</p>             | Name of the file to be uploaded (e.g., Report\_Q2.pdf)                                                         |
| <p>\<WaitTime(in seconds)><br>(Optional)</p> | Wait time before action execution                                                                              |
| <p>\<abs><br>(Optional)</p>                  | If the **abs** is provided, the action is performed with absolute identification using the **absolute X path** |

{% hint style="warning" %}
**Note:**&#x20;

* *If the ‘wait (in seconds)’ input is specified, then the action will be performed after the duration of the specified wait time.*
* *If for last argument abs is defined, then the Action must be executed with absolute preformation with the specified visible text in the input.*&#x20;
* *To skip an optional input value, use an extra semicolon (;).*
  {% endhint %}

**Output Value**

| Argument                                                    | Description                                                                          |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| \<Dynamic Variable>(Optional);\<Dynamic Variable>(Optional) | This dynamic variable stores the result of the verification as **True** or **False** |

**Example**&#x20;

**Uploads a specified file to the selected input field in the application interface**

The **Upload a File** action takes the value from the Input Value column (e.g., **input;;0;C:\Documents\Reports;Report\_Q2.pdf;3**) and uploads the given file after the specified wait time. The result of the file upload operation is stored in the **{Upload}** variable, with the following possible values:

* **True** – if the file is uploaded successfully.
* **False** – if the file upload fails.

<figure><img src="/files/6dVeKwLBdsbFNZ6J3XDz" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs.avoautomation.com/avo-assure/actions/web/custom/upload-a-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
