> For the complete documentation index, see [llms.txt](https://docs.hubyte.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hubyte.de/artikel-konfigurator/english-documentation/medienupload.md).

# Media upload

With the **Media upload** field type, the customer can upload a file on the product detail page – for example a logo to be printed, a template or a photo. The uploaded file is assigned to the line item and is available in the order.

<figure><img src="https://1189706915-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fo2EmDUXZFyGJxLrNilOU%2Fuploads%2FMN1eHuhgckYTpD3prVsv%2Fsw6-plugin-article-configurator-field-example-media.webp?alt=media&amp;token=213d8d06-0214-4b40-9224-f9d1778d3c2c" alt=""><figcaption></figcaption></figure>

## Creating a "Media upload" field

1. Create a new field under **Own/Additional Fields**.
2. Select **Media upload** as the **field type**.
3. Configure the upload settings:

| Setting                   | Description                                                                                                      |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **Allowed file formats**  | Selection of the permitted file formats. Only visible if the format restriction is enabled globally (see below). |
| **Max upload size in kB** | Limits the file size of the upload.                                                                              |

## Global settings for media upload

In the [plugin configuration](/artikel-konfigurator/english-documentation/plugin-konfiguration.md) you will find additional, globally valid options in the **Field type: Media upload** section:

| Setting                   | Key                   | Description                                                                                                            |
| ------------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **Show preview image**    | `previewImage`        | Shows a preview image in the article after the upload.                                                                 |
| **Image width in px**     | `imageWidth`          | Width of the preview image during media upload (default: 50).                                                          |
| **Restrict file formats** | `fileTypeRestriction` | If active, the permitted file formats can be restricted per field. If the option is disabled, all formats are allowed. |

## Behavior in the frontend

The customer selects a file in the upload field. If the preview is enabled and it is an image, a preview image is shown in the configured width. When adding to the cart, the file is taken over and assigned to the line item.

> **Tip:** Restrict the permitted file formats and the maximum size sensibly to avoid faulty uploads and very large files. For print templates, `pdf`, `png` and `jpg` are common, for example.
