# Posting PDF-files multipart/form-data solution

**URL:** <https://discourse.nodered.org/t/posting-pdf-files-multipart-form-data-solution/58914>\
**Category:** General\
**Tags:** http-request\
**Created:** [24 February 2022 09:35 UTC](https://discourse.nodered.org/t/posting-pdf-files-multipart-form-data-solution/58914 "2022-02-24T09:35:25Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [25 February 2022 10:07 UTC](https://discourse.nodered.org/t/posting-pdf-files-multipart-form-data-solution/58914/4 "2022-02-25T10:07:27Z")

</div>

> [@VincentSC](#):
>
> Lots of NodeRed is quite messy and buggy, so it's difficult to find good answers.

The help sidebar for the HTTP Request node tells you how to do a file upload.

> File Upload
> 
> To perform a file upload, `msg.headers["content-type"]` should be set to `multipart/form-data` and the `msg.payload` passed to the node must be an object with the following structure:
> 
> ```auto
> {
> "KEY": {
> "value": FILE_CONTENTS,
> "options": {
> "filename": "FILENAME"
> }
> }
> }
> 
> ```
> 
> The values of `KEY` , `FILE_CONTENTS` and `FILENAME` should be set to the appropriate values.

---

_[View the full topic](https://discourse.nodered.org/t/posting-pdf-files-multipart-form-data-solution/58914)._
