n8n Base64 File Upload: Convert Binary Data to a Public URL
n8n is good at moving JSON between tools. Files are different. A file might appear as binary data, a temporary download URL, or a base64 string depending on the previous node.
If your workflow already has a base64 string, do not fight the multipart form-data setup. Send JSON to FilePost's base64 upload endpoint and get a permanent CDN URL back.
The Short Version
| Workflow state | Best upload path |
|---|---|
| Binary file property | FilePost node or multipart HTTP Request |
| Base64 string in JSON | POST /v1/upload/base64 |
| Temporary file URL | Download first, then upload the file |
Step 1: Get the Base64 String
If your previous node already returns a field such as pdf_base64, file_base64, or data, you can use that field directly.
If your previous node outputs binary data, use n8n's file conversion tools first. n8n documents the Extract From File node, including the operation that moves file data into a base64 string. n8n also has a Convert to File node for the opposite direction.
Step 2: Add an HTTP Request Node
Add an HTTP Request node after the node that holds your base64 string.
- Method:
POST - URL:
https://filepost.dev/v1/upload/base64 - Authentication: none in n8n, because the API key is sent as a header
- Headers:
X-API-Keyset to your FilePost API key - Body content type: JSON
n8n's HTTP Request node can send JSON bodies and form-data bodies. For this base64 flow, choose JSON.
Step 3: Send the JSON Body
The FilePost endpoint expects a filename, optional content type, and one base64 data field. Use data_base64 when possible.
{
"filename": "report.pdf",
"content_type": "application/pdf",
"data_base64": "{{$json.pdf_base64}}",
"expires_in": "7d"
}
If your field has a different name, replace {{$json.pdf_base64}} with the actual n8n expression from your node output.
The expires_in field is optional. Remove it if the URL should stay live until you delete it.
Step 4: Use the Response URL
FilePost returns JSON like this:
{
"file_id": "a1b2c3d4e5f6",
"url": "https://cdn.filepost.dev/file/filepost/uploads/a1/a1b2c3/report.pdf",
"name": "report.pdf",
"size": 58231,
"content_type": "application/pdf",
"expires_at": "2026-07-02T12:00:00Z"
}
Use the url field in later nodes: Slack messages, Airtable records, Google Sheets rows, CRM updates, email bodies, webhook responses, or any other text field.
Common n8n Problems
It uploads but the file is corrupted
Make sure you send only the base64 string. Do not include a full data URL prefix such as data:application/pdf;base64,. FilePost accepts data URLs, but plain base64 is easier to inspect and debug.
The JSON body is invalid
Use n8n's JSON body editor or data structure mode rather than manually concatenating long strings. Base64 can contain characters that make hand-written JSON fragile if quoting is wrong.
The file is too large
Base64 adds overhead. If the original file is large, use the normal multipart upload flow instead. FilePost plan limits still apply after decoding: 50 MB on Free, 200 MB on Starter, and 500 MB on Pro.
Upload base64 files from n8n
Send JSON to FilePost and get a permanent CDN URL for your workflow output.
Get Your API Key