PDF file upload not recognized by webhook node via POST request

I am using n8n cloud version

For context, I would an website that enables user to upload pdf files and webhook should handle the get the file payload as well as fileName, fileSize. However only 2 attributes cam through but not the file payload. I tried various ways such as naming the “Field Name for Binary Data“ to “data“ and “file“ but that doesn’t work. Moreover, I also tried turning on raw output but also did not work.

This is how the output looks like, as you can see, only 2 attributes came through but not for the file payload.

This is the source code that sends the POST request to n8n workflow through webhook.

I am still beginner to n8n as well as javascript and react therefore, I might miss out some details.

Thank you for your kindness in advance

hello @Siroj_Wongpitakroj

n8n has two types of payload: JSON and binary. File data would be stored in the binary property.

I can’t say what the issue is, as the code doesn’t look like it was used in the code node.

But the first screen shows that you have a file.

Thank you for your response

I do understand that the file came through since I was able to download the file in webhook n8n node however the payload did not come through as I do not see any file in the body of the output as you can see in the 2nd figure.

Additionally, the code in the 3rd figure was not the code used in code node. It was the code from source code which is a website that will send file to the webhook through post request.

Another thing I noticed is that whatever the field name would, in this case, “file”, the title of the file in the output would always be concatenated with 0, in this case, “file0“. I tried changing to “file0” and the output tile is “file00“. I tried changing it to “data”, it then becomes “data0“

That’s intended behaviour. But you can split all files into separate items:

like here