n8n - ✅(Solved) Fix HTTP Request node: File not attached when sending multipart-form-data (400 "No file field in request") [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
n8n-io/n8n#28854Fetched 2026-04-23 07:44:22
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
commented ×1labeled ×1mentioned ×1subscribed ×1

Error Message

  1. API returns 400 error: "No file field in request" Error Response: "rawErrorMessage": ["400 - "{\"error\":\"No file field in request\"}\n""], Actual behavior: The request is sent, but the file field is missing from the request body. The API returns a 400 error indicating no file was received.

PR fix notes

PR #29022: fix(Http Request): preserve multipart filenames for binary uploads

Description (problem / solution / changelog)

Summary

  • preserve a filename when the HTTP Request node uploads binary data as multipart form-data
  • add regression coverage for multipart binary requests and the missing-fileName case

Root cause

When the incoming binary data had no fileName, the multipart part was serialized without a filename attribute. Some APIs only recognize that part as a file upload when filename is present, so they responded as if no file field had been sent.

Changes

  • default the multipart upload filename to file when binary metadata does not include fileName
  • add tests to verify the node sends a FormData payload and keeps a fallback filename in the multipart body

Validation

  • pnpm --dir packages/nodes-base exec jest nodes/HttpRequest/test/node/HttpRequestV3.test.ts --runInBand
  • pnpm --dir packages/nodes-base exec eslint nodes/HttpRequest/V3/HttpRequestV3.node.ts nodes/HttpRequest/test/node/HttpRequestV3.test.ts
  • git diff --check

Fixes #28854

Changed files

  • packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts (modified, +1/-1)
  • packages/nodes-base/nodes/HttpRequest/test/node/HttpRequestV3.test.ts (modified, +111/-0)
RAW_BUFFERClick to expand / collapse

Bug Description

When using the HTTP Request node (v4.4) to send a binary file via multipart-form-data, the request is sent but the file is not properly attached. The receiving API returns 400 - "No file field in request".

The same request works correctly when executed via curl, confirming the API endpoint is functioning properly.

Additional observation: In the Webhook node, I set "Field Name for Binary Data" to invoice_file, but the output still shows the binary data under data0. This may be related - if the binary property key isn't being set correctly, the HTTP Request node may not be finding the binary data at the expected location.

Screenshot attached showing:

<img width="1788" height="1434" alt="Image" src="https://github.com/user-attachments/assets/43b1c11c-8740-43b2-8aaf-99bbb58a2ab1" />

"Field Name for Binary Data" set to invoice_file Output showing binary data under data0 instead

To Reproduce

  1. Create a workflow with binary data available (e.g., PDF from a previous node)
  2. Add an HTTP Request node configured to send the file via multipart-form-data
  3. Execute the workflow
  4. API returns 400 error: "No file field in request"

Node Configuration { "parameters": { "method": "POST", "url": "https://example.com/api/endpoint", "authentication": "genericCredentialType", "genericAuthType": "httpBearerAuth", "sendBody": true, "contentType": "multipart-form-data", "bodyParameters": { "parameters": [ { "parameterType": "formBinaryData", "name": "file", "inputDataFieldName": "data0" } ] } }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.4 }

Error Response: { "errorMessage": "Bad request - please check your parameters", "errorDescription": "No file field in request", "errorDetails": { "rawErrorMessage": ["400 - "{\"error\":\"No file field in request\"}\n""], "httpCode": "400" } }

Expected behavior

The file should be attached to the multipart-form-data request with the field name "file", and the API should receive it correctly.

Actual behavior: The request is sent, but the file field is missing from the request body. The API returns a 400 error indicating no file was received.

Debug Info

The API works correctly with curl: curl -X POST "https://example.com/api/endpoint"
-H "Authorization: Bearer TOKEN"
-F "file=@/path/to/document.pdf"

Operating System

Linux Ubuntu LTS 24.4

n8n Version

2.17.3

Node.js Version

v24.14.1

Database

PostgreSQL

Execution mode

main (default)

Hosting

self hosted

extent analysis

TL;DR

The issue is likely due to the mismatch between the expected field name for binary data in the HTTP Request node and the actual field name used, which can be resolved by ensuring the field name is correctly set.

Guidance

  • Verify that the "Field Name for Binary Data" in the Webhook node matches the expected field name in the HTTP Request node, which is set to "file" in the bodyParameters.
  • Check the inputDataFieldName in the bodyParameters of the HTTP Request node, which is currently set to "data0", and update it to match the expected field name if necessary.
  • Review the documentation for the HTTP Request node to ensure that the formBinaryData parameter type is correctly configured for sending binary files via multipart-form-data.
  • Test the workflow with a different binary file or a different API endpoint to isolate the issue and confirm that it's not specific to the current file or endpoint.

Example

No code snippet is provided as the issue seems to be related to the configuration of the nodes rather than a code-specific problem.

Notes

The issue might be specific to the version of the HTTP Request node (v4.4) or the n8n version (2.17.3), and upgrading to a newer version might resolve the issue. However, without further information, it's difficult to determine the root cause.

Recommendation

Apply workaround: Update the inputDataFieldName in the bodyParameters of the HTTP Request node to match the expected field name, and verify that the "Field Name for Binary Data" in the Webhook node is correctly set. This should resolve the issue if the problem is indeed related to the field name mismatch.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The file should be attached to the multipart-form-data request with the field name "file", and the API should receive it correctly.

Actual behavior: The request is sent, but the file field is missing from the request body. The API returns a 400 error indicating no file was received.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING