Issue with receiving images through webhook in binary format

Hello N8N community, I’m facing an issue with my application’s image upload functionality, which was working fine until recently and I didn’t change any FE code so issue must be N8N side. The setup involves sending an image along with other form data to a N8N webhook. See: https://i.imgur.com/Pzhde6A.png

The problem is that N8N doesn’t seem to be receiving the image in binary format anymore, but as a JSON object instead. This is happening despite the fact that I’m using a ‘multipart/form-data’ POST request and appending the image to a FormData object.

The JavaScript code I’m using to create the FormData object looks like this:

javascriptCopy code

let formData = new FormData();
formData.append('id', userId);
… more text fields
formData.append('file', imageFile);

The API and server are functioning as expected, and I can confirm that the FormData object is correctly populated with both the image and the other data on the client side. However, when I inspect the request headers, I see that the ‘Content-Type’ is set to ‘application/json; charset=utf-8’, even though I’m sending a ‘multipart/form-data’ request.

I tried using different clients and the issue remains.

Here’s an example of the headers I’m seeing:

(Request Headers)

cssCopy code

Content-Length: 916342
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDKUAgCzAjKmAecLQ
...

(Response Headers)

cssCopy code

Content-Length: 34
Content-Type: application/json; charset=utf-8
...

I haven’t made any changes to my font-end code. Has anyone else encountered this problem or have any suggestions on what I might be missing?

Any help would be greatly appreciated! Best, Kaspar

Did you make any changes to your n8n setup? Different reverse proxy? Upgraded n8n? Changes to the workflow?

Didn’t touch the N8N. Yes, made some changes in the workflow but paused all the other nodes and my first node is Webhook that I didn’t make any changes and it was receiving the image in binary data earlier.

Without touching anything it started working again after some weeks passed. Hope it won’t happen again🙂

1 Like