# Form-data multipart-encoded request with pdf file attached into the body

**URL:** https://discourse.nodered.org/t/form-data-multipart-encoded-request-with-pdf-file-attached-into-the-body/44749
**Category:** General
**Created:** [26 April 2021 13:34 UTC](https://discourse.nodered.org/t/form-data-multipart-encoded-request-with-pdf-file-attached-into-the-body/44749 "2021-04-26T13:34:45Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [26 April 2021 13:39 UTC](https://discourse.nodered.org/t/form-data-multipart-encoded-request-with-pdf-file-attached-into-the-body/44749/2 "2021-04-26T13:39:33Z")

</div>

Hi @vmoscolini

At a glance, I would expect the following to work:

> [@vmoscolini](#):
>
> ```auto
> msg.headers = {
> "content-type" : 'multipart/form-data'
> };
> 
> msg.payload = {
> "file": {
> "value": msg.payload.byteArray,
> "options": {
> "filename": msg.payload.fname
> }
> }
> }
> 
> ```

Assuming `msg.payload.byteArray` is a `Buffer` containing the pdf and `msg.payload.fname` is a String with the filename in.

I also assume you have configured the HTTP Request node to do a `POST` rather than the default `GET`?

It may be worth passing the message to a Debug node so you have verify exactly what you're passing to the Request node.

---

_[View the full topic](https://discourse.nodered.org/t/form-data-multipart-encoded-request-with-pdf-file-attached-into-the-body/44749)._
