Skip to main content

File Utils

Convert between base64 strings and files, or zip and unzip files.

Overview

The File Utils node converts files to base64-encoded strings and vice versa, and compresses or extracts zip archives. 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
  • Compress one or more files into a single .zip archive to save space or prepare them for download
  • Extract the contents of a .zip archive into individual files for downstream processing
  • Bridge between text-based workflows and file-based workflows

Files from any source (Google Drive, OneDrive, SharePoint, ShareFile, temporary bucket) are supported, and results can be written to any file destination.

Parameters

ParameterDescriptionRequired
OperationBase64 to File, File to Base64, Compress, or DecompressYes

The remaining parameters depend on the selected operation.

Base64 to File

Converts a base64-encoded string into a file.

ParameterDescriptionRequired
Base64 ContentThe base64-encoded string. Supports expressions.Yes
FilenameName for the output file (e.g. report.pdf). Supports expressions.Yes
File DestinationWhere to save the created file.Yes
{{ $item.data.base64String }}

File to Base64

Converts a file into a base64-encoded string.

ParameterDescriptionRequired
FileThe 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.

Compress

Compresses one or more files into a single .zip archive.

ParameterDescriptionRequired
FilesThe files to compress into a single archive. Accepts a list of files or an expression resolving to one. Supports expressions.Yes
Archive NameName for the output .zip file (e.g. archive.zip). Defaults to the source file name when compressing a single file, otherwise archive.zip. Supports expressions.No
File DestinationWhere to save the zip archive.Yes

Compression runs on the server using the native zlib DEFLATE codec. Each file becomes an entry in the archive; files that share a name are disambiguated automatically (e.g. report.pdf, report (1).pdf).

Decompress

Extracts the contents of a .zip archive.

ParameterDescriptionRequired
FileThe zip archive to extract. Supports expressions.Yes
File DestinationWhere to save the extracted files.Yes

Each file inside the archive is emitted as its own output item. The directory structure is preserved: a nested entry such as reports/q1.pdf keeps its full path as the file name, so two files with the same base name in different folders (e.g. dir1/report.pdf and dir2/report.pdf) stay distinct rather than colliding. For the temporary bucket destination the path becomes part of the stored file name; other destinations map the path onto their own folder structure. Directory entries and any .. path segments are ignored.

To guard against zip bombs, decompression is rejected when an archive contains more than 1000 files, when any single entry exceeds 250 MB uncompressed, or when the combined uncompressed size exceeds 500 MB.

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"
}

Compress

Produces a single item with a file property containing the created archive:

{
"file": {
"type": "fileData",
"name": "report.zip",
"fileInfo": { "type": "temporaryLidoBucket", "bucketFileName": "..." }
}
}

Decompress

Produces one item per file contained in the archive. The name preserves the entry's path within the archive:

{
"file": {
"type": "fileData",
"name": "reports/page-1.pdf",
"fileInfo": { "type": "temporaryLidoBucket", "bucketFileName": "..." }
}
}

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:

[Import Table (Lido Table with 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)]

Unzip an email attachment

[Outlook Trigger] → [File Utils (Decompress)] → [OCR PDF]
  • Operation: Decompress
  • File: {{ $item.file }}

Each file inside the archive flows downstream as its own item.

Tips

  • The node processes items one at a time. Most operations produce one output item per input; decompressing one archive can produce many items.
  • Base64 encoding increases data size by roughly 33%
  • Empty base64 content or blank filenames will cause the node to error
  • When working with files, the node handles any storage provider automatically by copying to a temporary bucket first
  • Use expressions to build dynamic filenames from upstream data
  • Decompressing a file that is not a valid zip archive will cause the node to error