> 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="https://1896308808-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdFpuRAnTVYgmlCXLLou%2Fuploads%2FDAkoINbqNTZrc2urWOzn%2Fmultipart-form-data-example_-_Midio.png?alt=media&amp;token=f6cf9a96-e3a5-4764-9569-e45af932a437" 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 %}
