Moving files between systems is one of the most common automation jobs: an invoice PDF from an email to accounting software, a photo from a form to cloud storage, a CSV export from one tool to another. When there is no native node for the destination, the HTTP Request node does it, as long as you choose the right body type.
In short. To download, set Response Format to File: the file lands in a binary property (usually data). To upload, choose Body Content Type: Form-Data with a parameter of type n8n Binary File for multipart APIs (the most common), or n8n Binary File as the whole body for APIs that expect raw bytes. The file name sent comes from the binary data, not from the field name.
Download a file
- 1 Method GET, URL of the file or of the API's download endpoint.
- 2 Add Option > Response Format > File.
- 3 Put Output in Field:
data(or any name you will reference later).
The output item now carries the file in binary.data, with a MIME type and, when the server provides one, a file name. Pass it to Google Drive, an email node, Extract from File, or another HTTP Request.
If the API returns JSON with a link instead of the file, make two requests: one to get the link, one to download it.
Upload as multipart form-data
This is what most "upload a file" endpoints expect. It is the same format a browser uses for a file input.
- 1 Method POST (or what the API says).
- 2 Send Body on, Body Content Type: Form-Data.
- 3 Add a body parameter, Type: n8n Binary File.
- 4 Name: the form field name from the API documentation, often
file. - 5 Input Data Field Name: the binary property holding the file, such as
data. - 6 Add other text fields the API requires (folder ID, description) as normal parameters.
Upload as a raw binary body
Some APIs (certain storage services, "PUT the bytes to this URL" uploads) want the file as the entire body. Choose Body Content Type: n8n Binary File and the binary property. n8n sets Content-Type to the file's MIME type, or application/octet-stream if it has none, and does not add a multipart envelope.
| The API documentation shows | Body Content Type |
|---|---|
curl -F "file=@invoice.pdf" | Form-Data, parameter type n8n Binary File |
curl --data-binary @invoice.pdf | n8n Binary File |
| A JSON body with a base64 string | JSON, with the base64 value built in a Code node |
Not sure? Paste the API's cURL example into our cURL to n8n converter to see which body type it maps to.
Fix: 415 Unsupported Media Type
The documentation explains it: the API expects multipart/form-data, but you sent the file as the whole body. Switch Body Content Type to Form-Data and add the file as an n8n Binary File parameter.
Fix: the API says the file is missing, or uses the wrong name
With Form-Data, n8n takes the part's file name from the binary data, not from the Name field. Name only sets the form field. If the binary has no file name, n8n sends file. APIs that identify uploads by file name or extension then reject it, often with a 400.
Set the name before the HTTP Request node, either with the File Name option of the Convert to File node, or in a Code node as the documentation shows:
Fix: wrong binary property name
"No binary data property 'data' exists on item" means the file is stored under another key. Open the previous node's output, look at the Binary tab, and copy the exact property name into Input Data Field Name.
Large files
- Webhooks receiving files are limited to 16 MB by default (
N8N_PAYLOAD_SIZE_MAXon self-hosted). - Big downloads use memory and disk; run them in batches rather than hundreds at once.
- Raise the request Timeout for slow storage endpoints. See HTTP Request timeouts.
Worked example: invoice attachments from email to your accounting tool
Suppliers email PDF invoices. You want each PDF uploaded to your accounting software's "documents" endpoint, which expects multipart form-data with a field named file and a type field.
- 1 Email trigger (IMAP or Gmail) with attachments downloaded. Each attachment arrives as binary data (often
attachment_0,attachment_1). - 2 Split attachments into items if several PDFs arrive in one email. A short Code node does it:
- 1 HTTP Request: POST to the documents endpoint, Body Content Type: Form-Data, parameter
fileof type n8n Binary File with Input Data Field Namedata, parametertype=invoice. - 2 IF on the response: store the document ID, or route failures to an alert.
Every PDF becomes its own item, keeps its original file name, and is uploaded with the field names the API expects.
Downloads: choosing the response format
| Response Format | Use when |
|---|---|
| Autodetect | Most cases; n8n detects JSON, text or file |
| File | You know the response is a file, and want it in a named binary property |
| JSON | The API returns JSON with a wrong content type |
| Text | You want the raw body as a string |
For pre-signed download links (S3, Google Cloud Storage and similar), the link itself carries the authorisation: send a plain GET without credentials, before the link expires.
Uploads to pre-signed URLs
Storage services often give you a pre-signed upload URL. These usually expect a PUT with the raw file as the body, not multipart:
- Method: PUT
- Body Content Type: n8n Binary File
- Input Data Field Name:
data - A
Content-Typeheader matching what the URL was signed for, if the service requires it
Sending multipart to a pre-signed PUT URL usually stores a corrupted file that includes the multipart boundaries.
Troubleshooting table
| Symptom | Likely cause | Fix |
|---|---|---|
| 415 Unsupported Media Type | Raw body sent, multipart expected | Body Content Type: Form-Data |
| 400 "file missing" | Wrong form field name | Use the field name from the API docs |
| File saved as "file" | No file name on the binary data | Set fileName before uploading |
| Uploaded file is corrupted | Multipart sent to a raw-body endpoint | n8n Binary File body, PUT |
| "No binary data property" | Wrong Input Data Field Name | Copy it from the Binary tab |
| 403 on a pre-signed link | Link expired or headers differ | Generate a fresh link; match signed headers |
Production checklist
- The binary property name checked on real data, not assumed.
- File names and MIME types set explicitly before uploads.
- The destination's maximum file size known and checked with an IF node.
- An error path that tells you which file failed.
Frequently asked questions
How do I download a file with the n8n HTTP Request node?
Set Response Format to File in the node options. The file is stored in a binary property, data by default.
How do I upload a file with multipart form-data in n8n?
Set Body Content Type to Form-Data, add a body parameter of type n8n Binary File, set its Name to the API's field name and Input Data Field Name to your binary property.
Why does my uploaded file arrive as "file" with no extension?
n8n uses the file name stored on the binary data. Set fileName on the binary property (Convert to File option or Code node) before uploading.
What causes a 415 error when uploading from n8n?
The API expects multipart form-data but received a raw binary body. Switch to Form-Data with an n8n Binary File parameter.
How do I send a file and JSON fields in the same request?
Use Form-Data: one parameter of type n8n Binary File, and other parameters as text. If a field must contain JSON, send it as a text parameter with JSON.stringify().
How do I download a file that needs authentication?
Attach the credential to the HTTP Request node as for any call, and set Response Format to File.
Can I upload several files in one request?
If the API accepts several file fields, add several n8n Binary File parameters, each pointing to a different binary property.
Tags
Steve founded PURIST, a workflow automation studio working with n8n, Make and Claude AI, and is the point of contact on every project. Prices and features in our articles come from vendor documentation and public pricing pages. How we research and score tools.