Skip to content

Error uploading binary file with Form-Data: Cannot read properties of null (reading 'name') #18175

Description

@leesilverman

Bug Description

Trying to upload files using HTTP request node / Body Parameters / Parameter type n8n Binary File.

I am as positive as I can be that I'm including the parameter name and the attachment data field name, but I'm getting the error "Cannot read properties of null (reading 'name')". I'm pretty sure the "Name" field is for the parameter name, but it also fails if I put the filename there. I've included both versions in my example workflow.

It's certainly possible I'm doing something wrong, but if so I think the documentation or tooltips should be updated because I think I'm doing the obvious things.

To Reproduce

Use this workflow to try to submit one or two attachments.

{
"nodes": [
{
"parameters": {
"formTitle": "15/10 Open a Support Ticket",
"formDescription": "Use this form to create a support ticket for 15/10",
"formFields": {
"values": [
{
"fieldLabel": "Attachments (optional)",
"fieldType": "file"
}
]
},
"responseMode": "lastNode",
"options": {
"buttonLabel": "Create Ticket"
}
},
"type": "n8n-nodes-base.formTrigger",
"typeVersion": 2.2,
"position": [
-880,
-928
],
"id": "1c9754be-1eb1-4240-b95a-251035dfd5ba",
"name": "On form submission1",
"webhookId": "bea8b17a-471a-400a-bbdc-c03e8c9e1edb"
},
{
"parameters": {
"method": "POST",
"url": "https://www.postb.in/1754743904955-1335371448658",
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"parameterType": "formBinaryData",
"name": "={{ $json.attachment.filename }}",
"inputDataFieldName": "={{ $json.attachment.attachment }}"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
144,
-1152
],
"id": "e7c24c96-be12-4c81-9fd0-8d756c501372",
"name": "Upload Attachments & get IDs1",
"onError": "continueErrorOutput"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "0bdb98d6-ea0a-4277-84aa-ba4af9831a8b",
"name": "attachments",
"value": "={{ Object.keys($binary).map(b => Object({attachment: b, filename: $binary[b].fileName})) }}",
"type": "array"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-512,
-1120
],
"id": "a1efb8c7-98ef-40a7-8333-2978d2377b3d",
"name": "attachment names array1"
},
{
"parameters": {
"fieldToSplitOut": "attachments",
"options": {
"destinationFieldName": "attachment"
}
},
"type": "n8n-nodes-base.splitOut",
"typeVersion": 1,
"position": [
-304,
-1120
],
"id": "b7a38d28-e4c4-405e-ac86-a3302ed6fa53",
"name": "Split Out1"
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineAll",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
-112,
-944
],
"id": "e8898a71-436a-4f0d-860c-ce592e9abfe8",
"name": "Merge1"
},
{
"parameters": {
"method": "POST",
"url": "https://www.postb.in/1754743904955-1335371448658",
"sendBody": true,
"contentType": "multipart-form-data",
"bodyParameters": {
"parameters": [
{
"parameterType": "formBinaryData",
"name": "file",
"inputDataFieldName": "={{ $json.attachment.attachment }}"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
144,
-944
],
"id": "31afec08-50fd-4421-8cb8-5f8c7aa7cb37",
"name": "Upload Attachments & get IDs2"
}
],
"connections": {
"On form submission1": {
"main": [
[
{
"node": "attachment names array1",
"type": "main",
"index": 0
},
{
"node": "Merge1",
"type": "main",
"index": 1
}
]
]
},
"attachment names array1": {
"main": [
[
{
"node": "Split Out1",
"type": "main",
"index": 0
}
]
]
},
"Split Out1": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
},
"Merge1": {
"main": [
[
{
"node": "Upload Attachments & get IDs2",
"type": "main",
"index": 0
},
{
"node": "Upload Attachments & get IDs1",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"instanceId": "56a3b6e808c84fdadd2d80585289500a7b27625c2792fc6c214518fe7ce0a003"
}
}

Expected behavior

The file should be uploaded using the parameter "file"

Debug Info

Debug info

core

  • n8nVersion: 1.105.3
  • platform: npm
  • nodeJsVersion: 22.18.0
  • database: postgres
  • executionMode: regular
  • concurrency: -1
  • license: enterprise (production)
  • consumerId: 6c524f2d-042e-4067-92e4-c47a67b81372

storage

  • success: all
  • error: all
  • progress: true
  • manual: true
  • binaryMode: filesystem

pruning

  • enabled: true
  • maxAge: 360 hours
  • maxCount: 50000 executions

client

  • userAgent: mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, like gecko) chrome/139.0.0.0 safari/537.36
  • isTouchDevice: false

security

  • secureCookie: false

Generated at: 2025-08-09T13:11:36.287Z

Operating System

Amazon Linux 2023 latest release

n8n Version

1.105.3

Node.js Version

22.18.0

Database

PostgreSQL

Execution mode

main (default)

Hosting

self hosted

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions