Postman to N8N - Binary file upload and write to local FS

Describe the problem/error/question

I am trying to build a simple API via N8N Webhook which will accept a Binary file and then write it to the local Filesystem.

The postman is sending the file as form-data of type File.

I do receive the file in the N8N Webhook and can see the details in the Binary section of the output.

When I try and Write this file to the local FS (accessible, writeable), N8N Write Files node throws the below error.

I have tried with following but with same results:
{{ $('Webhook').item.binary }}
{{ $('Webhook').item.binary.file.data }}

What is the error message (if any)?

Problem in node ‘Read/Write Files from Disk‘

The item has no binary field ‘undefined’ [item 0]

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version:1.50.1
  • Database (default: SQLite):default
  • n8n EXECUTIONS_PROCESS setting (default: own, main):default
  • Running n8n via (Docker, npm, n8n cloud, desktop app):Docker
  • Operating system:Linux

Leaving this here.

Managed to solve it by looking at other forum posts. Mainly this one: Unable to see/get binary data?

The field NAME from the Input node which holds the Binary needs to be specified AS IS in the Input Binary Field value.

Hope this helps someone…

1 Like

I had a few hair pulling moments with this also.

It’s not intuitive at all

Hi @gleeballs,

We are aware of this inconvenient UX and will change the data structure soon, so this should not be an obstacle anymore and our users can keep their hair :pray:

1 Like

nice - it’s now embedded after using it many times but a UI?UX improvement would be great for those that rarely use it or new people :slight_smile:

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