> For the complete documentation index, see [llms.txt](https://docs.theopenpresenter.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.theopenpresenter.com/plugins/developing-a-plugin/plugin-api/media/frontend/form-data.md).

# Form Data

{% hint style="info" %}
Whenever possible, we recommend using the [Tus](/plugins/developing-a-plugin/plugin-api/media/frontend/tus.md) endpoint instead.
{% endhint %}

### **Endpoint**

The form-data endpoint can be obtained through the pluginApi:

```typescript
pluginApi.media.formDataUploadUrl
```

### Headers

In addition to the headers described in [Frontend](/plugins/developing-a-plugin/plugin-api/media/frontend.md#required-headers), we also require the following headers to be set:

**upload-length**

The size of the uploaded media/file.

Here's an example of including these data using Uppy:

```typescript
new Uppy().use(XHR, {
  endpoint: pluginApi.media.formDataUploadUrl,
  headers: (file) => ({
    "csrf-token": appData.getCSRFToken(),
    "organization-id": pluginApi.pluginContext.organizationId,
    ...(file.size
      ? {
          "upload-length": file.size.toString(),
        }
      : {}),
  }),
})
```
