---
title: "Form.upload ViewHelper <f:form.upload>"
manual: "Fluid ViewHelper Reference"
version: "main"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-form-upload@main"
source: "Global/Form/Upload.rst"
modified: "2026-09-17T05:12:06+00:00"
---

# Form.upload ViewHelper `<f:form.upload>`

ViewHelper which renders an `<input type="file">` file upload HTML form element. Make sure to set the `enctype="multipart/form-data"` attribute on the surrounding form!

Go to the source code of this ViewHelper: [Form\\UploadViewHelper.php (GitHub)](https://github.com/TYPO3/typo3/blob/main/typo3/sysext/fluid/Classes/ViewHelpers/Form/UploadViewHelper.php).

**Table of contents**

-   [Examples](https://docs.typo3.org/permalink/t3viewhelper:examples@main)
-   [Arguments of f:form.upload](https://docs.typo3.org/permalink/t3viewhelper:arguments-of-f-form-upload@main)

## Examples

### Basic usage

**packages/my_extension/Resources/Private/Partials/Upload.fluid.html**

```html
<f:form.upload name="file" />
```

**HTML output**

```html
<input type="file" name="file" />
```

### Example for allowed MIME types / file extensions (native HTML5 attribute)

**packages/my_extension/Resources/Private/Partials/Upload.fluid.html**

```html
<f:form.upload name="file" accept=".gif,.jpg,image/jpg,image/jpeg,image/gif" />
```

**HTML output**

```html
<input type="file" name="file" accept=".gif,.jpg,image/jpg,image/jpeg,image/gif" />
```

> [!TIP]
> **Hint**
>
> The `accept` attribute is a native HTML5 element. It has no specific Extbase or Fluid implementation,
> and validation of the incoming file is only performed on the client. It does not replace proper
> server-side validation, so `UploadedFile` or Extbase file-upload
> handling must still be implemented.

## Arguments of f:form.upload

> **Allows arbitrary arguments**
>
> This ViewHelper allows you to pass arbitrary arguments not defined below
> directly to the HTML tag created. This includes custom `data-` arguments.

-   **additionalAttributes**

    -   *Type:* array

    Additional tag attributes. They will be added directly to the resulting HTML tag.

-   **aria**

    -   *Type:* array

    Additional aria-\* attributes. They will each be added with a "aria-" prefix.

-   **data**

    -   *Type:* array

    Additional data-\* attributes. They will each be added with a "data-" prefix.

-   **errorClass**

    -   *Type:* string
    -   *Default:* 'f3-form-error'

    CSS class to set if there are errors for this ViewHelper

-   **name**

    -   *Type:* string

    Name of input tag

-   **property**

    -   *Type:* string

    Name of Object Property. If used in conjunction with \<f:form object="...">, the "name" property will be ignored, while "value" can be used to specify a default field value instead of the object property value.

-   **value**

    -   *Type:* mixed

    Value of input tag
