PDF file sent to n8n Webhook appears corrupted or unreadable

I’m trying to send a binary file (PDF, XLSX, CSV, etc.) to a Webhook in n8n, but the file arrives corrupted. In the Webhook’s response body, the file content appears as unreadable text rather than binary data, preventing proper document processing. However, the received content still seems to be treated as text. How can I configure the n8n Webhook to properly accept and process binary files? Note: The document I’m sending is just a PDF with the text “ola mundo” (hello world in Portuguese). :sob: :sob:


It looks like your topic is missing some important information. Could you provide the following if applicable.

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

hello @igor.haya

How are you passing the file to the webhook? seems the Content-type header is missing or has a wrong type. My webhook is working fine

Hello, how are you?

I managed to solve it shortly after asking the question. it was indeed about that. I was only passing the URL and the FILE in the Webhook call, and by default, the Content-Type was being set to “multipart/form-data.” I’m not sure why, but the file was becoming unreadable that way. I was able to fix the issue by manually setting the headers={‘Content-Type’: f’{mime_type}'} in the Webhook call (for example, for PDF, it became 'Content-Type': 'application/pdf').

However, I still haven’t been able to solve the issue when the file is in .xlsx format. The characters in the table appear corrupted in n8n. If you know anything that might help, I’d be very happy. Thank you so much for your response!


According to the first lines, the binary file is not actually an XLSX, it’s a form-data object. So the file is not what it should be. You can manually check it by downloading the binary file and opening it in the Excel / text editor.

How are you uploading it to the webhook?