Corrupted PDF when downloading with HTTP Request

Describe the problem/error/question

I’m having an issue with the HTTP Request to download a PDF. When I make the call, it seems to download everything fine, but when I try to preview the document by using the download button it downloads a file, but the file seems to be corrupted and I’m unable to view. If I try to preview directly in editor, I get an empty gray file. I’m able to make the call and download just fine with cURL. Everything seems ok about mime type returned by the URL.
And all is working fine for png / jpg.


What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.43.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker 24.0.6 on self-hosted
  • Operating system: Ubuntu 22.04 x86_64

Welcome to the community @djiworks :tada:

By default, n8n uses memory to store binary data which can cause crashes like one you’re experiencing when handling large binary data files. To avoid this, set the environment variable N8N_DEFAULT_BINARY_DATA_MODE to filesystem which will allow you to save data to disk instead of in memory.
You can find more info in our docs here: Binary data > Enable filesystem mode

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