# Using the Multipart/form-data with binary data option

**URL:** <https://forum.alumio.com/t/using-the-multipart-form-data-with-binary-data-option/937>\
**Category:** Transformers\
**Created:** [January 16, 2024, 9:52am UTC](https://forum.alumio.com/t/using-the-multipart-form-data-with-binary-data-option/937 "2024-01-16T09:52:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![o.plokha](https://forum.alumio.com/user_avatar/forum.alumio.com/o.plokha/32/337_2.png) [@o.plokha](https://forum.alumio.com/u/o.plokha)\
**Post date:** [January 16, 2024, 9:52am UTC](https://forum.alumio.com/t/using-the-multipart-form-data-with-binary-data-option/937/1 "2024-01-16T09:52:39Z")

</div>

### Table of contents

- Introduction
- Guide

### Introduction

When files like images are uploaded to an API often a multipart/form-data request is required. Users can configure an HTTP client to use a “Plain” request body and configure the request themselves using hard-coded headers, and placeholders to select the binary data.

However, the placeholders use JMESPath to select the data. Depending on the binary data this can sometimes fail because JMESPath can’t handle the binary data correctly.

That’s why this guide helps you build an HTTP request using the multipart/form-data option.

### Guide

Step 1: Create an Entity transformer and select the “Data, transform data using mappers and conditions” option.

Step 2: Add an HTTP Transformer to the Data transformers.

Step 3: Fill out settings:

- Request URI;
- Request Method - should be _POST_;
- Payload type - select the _“Multipart/form-data” option_;
- Add value - select type _“Text”_ and fill out Key and Value and the content type should be _“text/plain”;_  
 ![image](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/2X/8/86716779371b5c7c8435f408d44ac3c50fce3899.png)
- Add value - select _“File”_ and add extra information:
  - Key;
  - Value - add _&{binaryData}_ in the field;
  - Type - _“File”_;
  - Filename - enter the name of the file;
  - Content type - should be _“images/jpeg”._
  - Enable the “Base64 decode value” checkbox.  
 ![image](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/2X/3/3a2b0eaaad20ac49b5e613a49e33554a4f0a7a9c.png)  
Step 4: Execute transformer.
