Help Needed: Can't Send PDF File via HTTP Request to External API (2 Weeks Stuck!)

Hi n8n team / community,

I’ve been stuck on this issue for over two weeks and I’m honestly losing my mind trying to get this to work. I’m using n8n Cloud (v1.84.3) and I’m trying to send a PDF file (binary) from an earlier node to a simple external Flask API deployed on Railway, which accepts a POST request with a PDF file under the key file0.

Here’s what I need:

  • Send a PDF file via POST to this endpoint:
    https://web-production-XXXXX.up.railway.app/ocr
  • The API expects the file to be sent as form-data (key: file0)
  • This works perfectly with Postman or curl.
  • The backend returns Missing file if the file isn’t sent properly.

What I’ve Tried in n8n:

  1. HTTP Request Node → POST
  • Method: POST
  • URL: correct
  • Body Content Type: n8n Binary File
  • Input Data Field Name: file0
  1. The file is confirmed as binary:
  • Binary property from previous node is set and named file0
  • File size and mime type (application/pdf) are correct
  1. I tried Raw mode, JSON, and everything else.
    I also do not see any option called “Send Binary Data” in the UI.

Error from the API:

json

CopyEdit

{
  "error": "Missing file"
}

And sometimes n8n throws:

javascript

CopyEdit

TypeError: Cannot read properties of undefined (reading 'value')
at prepareRequestBody ...

I also tried:

  • Switching to JSON view manually
  • Manually adding file0 as a binary property
  • Verifying file0 exists with a Code node before the HTTP Request

Please help :sob:

I just need to know:
How can I send a binary file (PDF) as form-data in a POST request using the current n8n Cloud version (no external modules, no custom code nodes)?

If this is not supported at all, please let me know so I can stop wasting time.

Thank you :pray:
– Pierre

Hi,you mentioned that with curl it worked. Cant you just import the curl, so you are sure about the request format?

Reg
Jiri.

i didnt understand. i i have the “file0” pdf ready to be sent via api, but in the “http” node its just not working.

Hi, you said you have successfully tried with curl. So you could import your curl command and it hopefully it will configure your http request as it should be.

The data part is another question.

Can you share your workflow?

Reg
J

hii’ i tried and i get this -
“Cannot read properties of undefined (reading ‘value’)”

this is my workflow -

The problem in settings of the server where you are sending the file.
I was able to reproduce your workflow to send a file to another n8n webhook and everything seems to work just right. Refer to your service’s API documentation for detailed guidance. Or post here curlcommand you are using.

Thanks so much for your response and for taking the time to test it!

Unfortunately, I’m still completely stuck :pensive:
I’ve tried every possible combination – Binary, form-data, n8n Binary File, raw, JSON – but my server (hosted on Railway) always returns:

json

CopyEdit

{
  "error": "Missing file"
}

In the HTTP Request node, I’ve set:

  • Method: POST
  • URL: https://web-production-5af82.up.railway.app/ocr
  • Body Content Type: multipart/form-data
  • Binary Property Name: file0

Still, nothing works. :weary:

For example, here’s the error I get from n8n:

sql

CopyEdit

Bad request - please check your parameters
Missing file

When testing with Postman (same URL, same file, same form-data with key file0), it works perfectly.

It seems like n8n isn’t sending the binary properly – or my server doesn’t recognize it as expected.

If there’s any example of a working config that sends a file as file0 using the HTTP Request node, I’d love to see it :pray:

I’ve been stuck on this for 2 weeks already and really appreciate any help.

Thanks again!
Pierre.

curl -X POST “https://pierresh.app.n8n.cloud/webhook-test/ae967fad-e0d4-40ad-aa4b-69f5da2ad285” -F “file=@"C:\Users\PierreShimony\Reeco\Omri Shalev - REECO@OPERATION\OPS\Supplier Group Catalog Item\Eddie M’s Seafood\Price Sheet for RADISSON BLU MALL OF AMERICA 02-07-25 at 9_04PM.pdf"”