QANode Logo

File to Base64 Node

The File to Base64 node receives a fileRef and returns the file content as Base64 and Data URI.


Overview

PropertyValue
Typefile-to-base64
CategoryFiles
Color🟤 Gold (#C89F65)
Inputin
Outputout

When to Use

Use this node when:

  • an API expects a file inside a JSON field as Base64;
  • you need to send file content in a message or payload;
  • you want to convert a fileRef into a Data URI;
  • another system does not accept multipart upload or binary upload.

Configuration

FieldTypeDescription
FilefileRefFile to convert
Include Data URIbooleanAlso returns dataUri with MIME prefix

Outputs

OutputTypeDescription
base64stringFile content in Base64
dataUristringData URI when enabled
namestringFile name
mimeTypestringMIME type
sizeBytesnumberOriginal file size

Accessing Outputs

{{ steps["file-to-base64"].outputs.base64 }}
{{ steps["file-to-base64"].outputs.dataUri }}
{{ steps["file-to-base64"].outputs.mimeType }}

Example: Send Base64 in JSON

[Generate File] → [File to Base64] → [HTTP Request]

HTTP body:

{
  "fileName": "{{ steps["file-to-base64"].outputs.name }}",
  "mimeType": "{{ steps["file-to-base64"].outputs.mimeType }}",
  "content": "{{ steps["file-to-base64"].outputs.base64 }}"
}

Round Trip

Use with Base64 to File when you need to convert both ways:

fileRef → Base64 → fileRef

Tips

  • Prefer fileRef between QANode nodes. Convert to Base64 only when the external system requires it.
  • Base64 increases payload size; avoid it for very large files.
  • Use dataUri when the receiving system expects the data:mime/type;base64,... format.