# Uploading multiple files at once

**URL:** https://discourse.nodered.org/t/uploading-multiple-files-at-once/34571
**Category:** General
**Created:** [20 October 2020 13:21 UTC](https://discourse.nodered.org/t/uploading-multiple-files-at-once/34571 "2020-10-20T13:21:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Filipus24](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/filipus24/32/30658_2.png) [@Filipus24](https://discourse.nodered.org/u/Filipus24)
#### Post date: [20 October 2020 13:21 UTC](https://discourse.nodered.org/t/uploading-multiple-files-at-once/34571/1 "2020-10-20T13:21:23Z")

</div>

Hello good folks,

I am trying to upload multiple files at once, from Node-RED to another server, using the _HTTP Request_ Node. The documentation explains the payload structure required to attach a single file:

```auto
{
    "KEY": {
        "value": FILE_CONTENTS,
        "options": {
            "filename": "FILENAME"
        }
    }
}

```

This works when I need to upload a single file, but what about multiple files?

Here's the architecture of my system:

- **SERVER 1** submits, through a single HTTP request, one or more files to Node-RED
- Node-RED captures these files with the _HTTP In_ node and forwards them to **SERVER 2** using the HTTP Request node. All files must be embedded into that single HTTP Request.
- **SERVER 2** processes the files and responds with a summary of the processing information to Node-Red
- Node-RED then simply sends back the response to **SERVER 1**

I unfortunately have no control over either **SERVER 1** or **SERVER 2** , so I cannot change the way they send/process files.

So in summary, I need all files received as a group to be forwarded as a group to the destination server so it can aggregate data pulled from all attachments it receives in a single transaction.

Judging from the JSON structure above, this isn't possible. Are there alternatives to the HTTP Request node for this specific use case?

Thanks

---

<div class="post-metadata">

### Author: ![Filipus24](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/filipus24/32/30658_2.png) [@Filipus24](https://discourse.nodered.org/u/Filipus24)
#### Post date: [20 October 2020 14:49 UTC](https://discourse.nodered.org/t/uploading-multiple-files-at-once/34571/2 "2020-10-20T14:49:51Z")

</div>

Well it looks like I answered my own question after digging through the code for the HTTP Request node: there can be as many "KEY" properties as you want in the payload structure:

```auto
{
    "File1": {
        "value": "some file content",
        "options": {
            "filename": "MyFirstFile.txt"
        }
    },
    "File2": {
        "value": "some other content",
        "options": {
            "filename": "MySecondFile.txt"
        }
    }
}

```

I personally think it would have been more explicit if the payload contained an array instead of distinct properties, but hey, what do I know?!? 🙂

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [3 November 2020 14:49 UTC](https://discourse.nodered.org/t/uploading-multiple-files-at-once/34571/3 "2020-11-03T14:49:52Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
