# File upload

{% hint style="danger" %}
**Important:** make sure to read the [Secure file uploads](/quick-start/secure-file-uploads.md) sections to understand how and where files are uploaded and handled based on your settings.
{% endhint %}

### About

The File upload element allows users to select an image or document from their device (mobile or desktop) for upload. This can be useful to gather additional information based on the use case of your WordPress form. For instance, if you own a car repair company and you want a customer to upload detailed photo's of the damage, they could do so via the File upload element. An example of how this would look on the front-end can be seen below:

<div align="left"><figure><img src="/files/kEG94twQPm9coEzI1G1b" alt="Example of a File upload element on your WordPress form."><figcaption><p>Example of a File upload element on your WordPress form.</p></figcaption></figure></div>

### Adding the File upload element to your form

Simply drag and drop the `File upload` element to your canvas:

<div align="left"><figure><img src="/files/6wV8xf5Wt1FBnMvC5yAV" alt="Adding the file upload element to your form."><figcaption><p>Adding the file upload element to your form.</p></figcaption></figure></div>

### Making the file upload required

To make the file upload required (at least 1 or more files are required) you can change the `Min characters/selections allowed` setting under the **Advanced** section when editing the File upload element as shown below. In the below example the user must upload at least 1 file.

<div align="left"><figure><img src="/files/oyqSgBXz5K4SovEymU2u" alt="Require a minimum amount of file uploads."><figcaption><p>Require a minimum amount of file uploads.</p></figcaption></figure></div>

### Setting a maximum file limit

If you want to limit the amount of files a user can upload you can change the `Max characters/selections allowed` setting under the **Advanced** section when editing the File upload element as shown below. In the below example the user is allowed to upload a maximum of 5 files in total.

<div align="left"><figure><img src="/files/dndwya8hNyQj3HYJZq05" alt="Allow a maximum amount of file uploads."><figcaption><p>Allow a maximum amount of file uploads.</p></figcaption></figure></div>

### Allow only specific extensions

If you want the user to only be able to upload specific file extension(s) then you can configure them via the below setting.

<div align="left"><figure><img src="/files/pOTvbwgilLfenvAi6mOr" alt="Define file extensions for your WordPress form file upload element"><figcaption><p>Allowing only specific file extensions for file upload for your WordPress site.</p></figcaption></figure></div>

### Limit the file size

<div align="left"><figure><img src="/files/sUwhONBDP65MaqvO9raw" alt="Define maximum file upload size"><figcaption><p>Setting a maximum file upload size.</p></figcaption></figure></div>


---

# 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.super-forms.com/elements/form-elements/file-upload.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.
