> For the complete documentation index, see [llms.txt](https://docs.midio.com/midio-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.midio.com/midio-docs/guides/http/uploading-files-multipart-form-data.md).

# Uploading Files (multipart/form-data)

Some APIs require you to upload files, which is usually done using the multipart/form-data content type.

This can be achieved in Midio using `Http.Body.Create Form Field File` `Http.Body.Create Form Field Value`  and `Http.Body.Encode Multipart FormData` .

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

In the example above, we fetch an image as a buffer, which we then convert to a form field file using `Create Form Field File`. All form fields are sent as inputs to `Encode Multipart FormData`, which returns two values: a `Content-Type` header value and the encoded body. We place the header value in an object with the field value `Content-Type` and use it in the headers input when calling the API that requires a file upload. We use the `multipart/form-data` output as the body.

{% hint style="warning" %}
It is important to include the header, as it contains information about how the form data is encoded in the body.
{% endhint %}
