# multipart/form-data in Connect-REST without base64

**URL:** <https://forums.pega.com/t/multipart-form-data-in-connect-rest-without-base64/3298>\
**Category:** General\
**Tags:** dx-api, financial-services, pega-platform, case-management, data-integration, senior-system-architect, lead-system-architect\
**Created:** [September 29, 2022, 5:30pm UTC](https://forums.pega.com/t/multipart-form-data-in-connect-rest-without-base64/3298 "2022-09-29T17:30:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arunkumar\_Velmurugan](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@Arunkumar\_Velmurugan](https://forums.pega.com/u/Arunkumar_Velmurugan)\
**Post date:** [September 29, 2022, 5:30pm UTC](https://forums.pega.com/t/multipart-form-data-in-connect-rest-without-base64/3298/1 "2022-09-29T17:30:34Z")

</div>

Hi All,

Whenever we attach any file in Pega, we need to perform a virus scan (to extend the call virus check functionality) using the existing API on the business side.

API will scan the file and based on the response we need to attach the file.

We have challenges sending a file as “multipart/form-data” in connection-REST.

Our external system does not accept Base64 format. So we should not send base64 format.

How to achieve this?

Regards,

AK

---

<div class="post-metadata">

**Author:** ![LANH\_ラン1](https://avatars.discourse-cdn.com/v4/letter/l/c4cdca/32.png) [@LANH\_ラン1](https://forums.pega.com/u/LANH_%E3%83%A9%E3%83%B31)\
**Post date:** [October 5, 2022, 8:00am UTC](https://forums.pega.com/t/multipart-form-data-in-connect-rest-without-base64/3298/2 "2022-10-05T08:00:27Z")

</div>

@AK\_\_\_

So what kind format accepted by the external system. I think you can use java to convert base64 format to accepted format and set value to RequestAttachmentPage. Try it out

---

<div class="post-metadata">

**Author:** ![basmasking](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/basmasking/32/6185_2.png) [@basmasking](https://forums.pega.com/u/basmasking)\
**Post date:** [October 13, 2022, 1:49pm UTC](https://forums.pega.com/t/multipart-form-data-in-connect-rest-without-base64/3298/3 "2022-10-13T13:49:40Z")

</div>

@AK\_\_\_

Pega has an undocumented feature on how to send multipart/form-data across a REST connection. It’s fairly simple, but you just need to know what values to set.

Below is a screenshot of a configuration of a multipart/form-data message that contains json instead of base64 data.

 ![Configuration of pyRequestAttachmentPage.png](https://pega1.discourse-cdn.com/pega/original/2X/b/b0af7807b7772bc960a7e7efca8b138c7e18e8c8.png)

The values you set translate into different values for the multipart message.

| Property | Multipart property | Example |
| --- | --- | --- |
| pyAttachValues | The actual content you’d like to send | { “json”: “data” } |
| pyAttachNames | name | “data” |
| pyAttachTypes | content-type | “application/json” |
| pyAttachFileNames | filename | “payload.json” |

When all set, the multipart message would like like below;

----WebKitFormBoundary7MA4YWxkTrZu0gW

Content-Disposition: form-data; name=“data”; filename=“payload.json”  
Content-Type: application/json

{ “json”: “data” }  
----WebKitFormBoundary7MA4YWxkTrZu0gW

Empty values are possible and leave that particular field out of the message. i.e. an empty pyAttachFieldNames value won’t send a filename.

Note that these properties are value lists and the example above is just for one multipart message. In case you need to send 2 parts, add another items to each list.

 ![Multipart.png](https://pega1.discourse-cdn.com/pega/original/2X/c/c2ce2480c06fcd7fd12a90c27b90428a58b419f3.png)

---

<div class="post-metadata">

**Author:** ![MarijeSchillern](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/marijeschillern/32/23321_2.png) [@MarijeSchillern](https://forums.pega.com/u/MarijeSchillern)\
**Post date:** [October 13, 2022, 2:48pm UTC](https://forums.pega.com/t/multipart-form-data-in-connect-rest-without-base64/3298/4 "2022-10-13T14:48:30Z")

</div>

@BasM7674 thanks for helping on this forum discussion!

I was wondering whether you can see any areas in our documentation where you think there is room for improvement.

Can you confirm if the functionality should be covered in the following documentation?

[File attachment configuration in REST and SOAP integrations](https://docs-previous.pega.com/data-management-and-integration/86/file-attachment-configuration-rest-and-soap-integrations)

Feel free to give us any feedback of what we could include to help users with this question in the future.

---

<div class="post-metadata">

**Author:** ![basmasking](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/basmasking/32/6185_2.png) [@basmasking](https://forums.pega.com/u/basmasking)\
**Post date:** [October 14, 2022, 11:56am UTC](https://forums.pega.com/t/multipart-form-data-in-connect-rest-without-base64/3298/5 "2022-10-14T11:56:49Z")

</div>

@MarijeSchillern I think that would be a good place to put it. I see half my explanation is already there, just the part how to send a multipart without an attachment is missing if you’d ask me.
