File Utils
Convert between base64 strings and files.
Overview
The File Utils node converts files to base64-encoded strings and vice versa. Use it to:
- Decode base64 data from an API response into a downloadable file
- Encode a file as base64 for embedding in a JSON payload or API call
- Bridge between text-based workflows and file-based workflows
Parameters
| Parameter | Description | Required |
|---|---|---|
| Operation | Base64 to File or File to Base64 | Yes |
The remaining parameters depend on the selected operation.
Base64 to File
Converts a base64-encoded string into a file.
| Parameter | Description | Required |
|---|---|---|
| Base64 Content | The base64-encoded string. Supports expressions. | Yes |
| Filename | Name for the output file (e.g. report.pdf). Supports expressions. | Yes |
| File Destination | Where to save the created file. | Yes |
{{ $item.data.base64String }}
File to Base64
Converts a file into a base64-encoded string.
| Parameter | Description | Required |
|---|---|---|
| File | The file to convert. Supports expressions. | Yes |
{{ $item }}
{{ $item.data.file }}
Files from any source (Google Drive, OneDrive, temporary bucket) are supported. The node copies them to a temporary bucket before encoding.
Output
Base64 to File
Produces an item with a file property containing the created file:
{
"file": {
"type": "fileData",
"name": "report.pdf",
"fileInfo": { "type": "temporaryLidoBucket", "bucketFileName": "..." }
}
}
File to Base64
Produces an item with the base64 string and original filename:
{
"base64": "JVBERi0xLjQK...",
"filename": "report.pdf"
}
Examples
Decode an API Response
An API returns a PDF as base64. Convert it to a file for downstream processing:
[Call URL (get PDF)] → [File Utils (Base64 to File)] → [Copy File (to Google Drive)]
- Operation:
Base64 to File - Base64 Content:
{{ $item.data.pdfContent }} - Filename:
{{ $item.data.documentName }}.pdf
Encode a File for an API Call
Send a file as base64 in a JSON request body:
[Get Table (file column)] → [File Utils (File to Base64)] → [Call URL (POST to API)]
- Operation:
File to Base64 - File:
{{ $item }}
Then in Call URL, reference {{ $item.data.base64 }} in the request body.
Round-Trip Conversion
Convert to base64, process the string, then convert back:
[Trigger] → [File Utils (File to Base64)] → [JS Code (modify)] → [File Utils (Base64 to File)]
Tips
- The node processes items one at a time — each input item produces one output item
- Base64 encoding increases data size by roughly 33%
- Empty base64 content or blank filenames will cause the node to error
- When converting File to Base64, the node handles files from any storage provider automatically
- Use expressions to build dynamic filenames from upstream data