> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-en/action-guides/keyboard/file-upload.md).

# File upload

File upload is the action of instructing the browser to automatically push one or more files (images, videos, Excel documents, txt...) from your computer to the target website's server.

#### Configuration parameters:

* XPath: The identifier path (XPath) that leads directly to the file upload frame of the website.

  > ⚠️ Important note: When automating with scripts, do not click directly on buttons labeled "Choose Image" or "Upload Image" (as it will open the file selection window of the Windows/macOS operating system, freezing the script). Instead, you must find the correct hidden tag structured as: `//input[@type='file']` on the website to fill in this XPath.
* File path: The absolute path leading to the file stored on your computer (e.g., `C:\Users\Admin\Desktop\avatar.png`). You can pass a variable containing a dynamic path here (e.g., `$filePath`).

#### Real-world example: Uploading product images to the system

When you script the posting of sales listings automatically to e-commerce platforms or social networks, the standard processing flow will be as follows:

* Configuration:
  * Element XPath: `//input[@type='file' and @name='product_image']` (Scan the page source to find this hidden input tag).
  * File path: `D:\DataPOD\Design01.png`
* Operational logic: GPM Automate will directly pass the file path `D:\DataPOD\Design01.png` into the `input` element of the website. The website's system will immediately recognize it and start the image upload process smoothly without displaying the Open File dialog of the operating system.

<figure><img src="/files/EZyTqnrGjo06bIbmN1lB" alt=""><figcaption></figcaption></figure>


---

# 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.gpmautomate.com/automate-en/action-guides/keyboard/file-upload.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.
