# I have a base64-encoded data stored in a variable, how do I send it using form-data content type?

**URL:** <https://community.postman.com/t/i-have-a-base64-encoded-data-stored-in-a-variable-how-do-i-send-it-using-form-data-content-type/39155>\
**Category:** Help Hub\
**Created:** [September 15, 2022, 10:21pm UTC](https://community.postman.com/t/i-have-a-base64-encoded-data-stored-in-a-variable-how-do-i-send-it-using-form-data-content-type/39155 "2022-09-15T22:21:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![science-astronomer-1](https://avatars.discourse-cdn.com/v4/letter/s/f475e1/32.png) [@science-astronomer-1](https://community.postman.com/u/science-astronomer-1)\
**Post date:** [September 15, 2022, 10:21pm UTC](https://community.postman.com/t/i-have-a-base64-encoded-data-stored-in-a-variable-how-do-i-send-it-using-form-data-content-type/39155/1 "2022-09-15T22:21:05Z")

</div>

I want to store a file as a base64-encoded variable in the collection.  
I then want to use `atob` to convert it into a binary array and send it using form-data content type.

I’ve tried using raw tab in the postman and hand-coded the body using a variable:

------WebKitFormBoundarySWVM8J7MzhwVMYiR  
Content-Disposition: form-data; name=“file”; filename=“wells.xlsx”  
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

{{Test2x2AsntDefBinary}}  
------WebKitFormBoundarySWVM8J7MzhwVMYiR–

But the binary values in the variable get encoded differently (text encoding issue maybe?)

So I try to send:  
pm.variables.set(‘Test2x2AsntDefBinary’, atob(btoa(“\xFF00”)));

but the following actually being sent:  
195 191 48 48

Related to this. How can I see the actual request sent?

---

<div class="post-metadata">

**Author:** ![science-astronomer-1](https://avatars.discourse-cdn.com/v4/letter/s/f475e1/32.png) [@science-astronomer-1](https://community.postman.com/u/science-astronomer-1)\
**Post date:** [September 16, 2022, 1:52pm UTC](https://community.postman.com/t/i-have-a-base64-encoded-data-stored-in-a-variable-how-do-i-send-it-using-form-data-content-type/39155/2 "2022-09-16T13:52:49Z")

</div>

195, 191 is a UTF8 encoding of character 255.  
So when I use `{{Test2x2AsntDefBinary}}` in the raw body - Postman encodes it using UTF8 encoding method.

using body `form-data` tab and passing the same variable (`{{Test2x2AsntDefBinary}}`) with `\xFF\xFF\xFF` as content also encodes the given string using UTF8. Which is not what I want. I want to send binary in the form I give it to Postman.
