Skip to content

Base64 to File

Base64 to File takes a base64-encoded string from the current data payload and materializes it as a real file on the Floogos server. The node returns a download URL and local path that downstream nodes can use — for example, to attach the file to an email, upload it to cloud storage, or trigger a file transfer.

This is typically used when an external API (billing system, ERP, signing service) returns a document encoded in base64 instead of a direct download URL.


FieldTypeRequiredDescription
base64_keytextNoName of the input field containing the base64 string. Supports dot notation (e.g. document.pdf_base64). Default: pdf_base64
filenametextNoOutput filename without extension. Supports dynamic variables: {{order_number}}, {{invoice_id}}, etc. Default: archivo
extensionselectNoFile extension: .pdf, .png, .jpg, .xlsx, .zip, .xml, .json, .txt, .csv, .html. Default: .pdf
content_typetextNoHTTP Content-Type override. If empty, auto-detected from the extension
base_urltextNoPublic engine URL for building the download link. Falls back to ENGINE_HOST env var. Required for on-premise deployments

If the filename already includes an extension (e.g. invoice.pdf), the separate extension field is ignored.


{
"filename": "factura_ORD-4821.pdf",
"filePath": "/temporal/cli_7/factura_ORD-4821.pdf",
"urlPath": "https://us1.floogos.com/download/cli_7/factura_ORD-4821.pdf",
"contentType": "application/pdf",
"size": 48291
}
FieldDescription
filenameFinal filename with extension
filePathAbsolute local path on the server
urlPathPublic download URL
contentTypeMIME type of the generated file
sizeFile size in bytes

Example 1 — Invoice PDF from Fiskaly / HubFiscal

Section titled “Example 1 — Invoice PDF from Fiskaly / HubFiscal”

After calling a billing API that returns a signed PDF in base64, decode it and email it as an attachment.

Webhook (receives order)
→ HTTP Request (POST to Fiskaly — returns { "pdf_base64": "JVBERi..." })
→ Base64 to File
base64_key: "pdf_base64"
filename: "invoice_{{@Webhook.order_number}}"
extension: ".pdf"
→ SendMail
to: "{{@Webhook.customer_email}}"
subject: "Your invoice {{@Webhook.order_number}}"
attachments: "{{@Base64toFile.urlPath}}"
→ End

Some APIs return the base64 inside a nested object. Use dot notation to access it.

{
"base64_key": "document.content.data",
"filename": "report_{{@HTTP.data.report_id}}",
"extension": ".xlsx"
}

Input structure:

{
"document": {
"content": {
"data": "UEsDBBQAAAAI..."
}
}
}

Example 3 — Upload to Google Drive after decoding

Section titled “Example 3 — Upload to Google Drive after decoding”

Decode a base64 XML document and upload it to Google Drive.

Base64 to File
base64_key: "xml_base64"
filename: "export_{{@Webhook.date}}"
extension: ".xml"
→ Google Drive (upload file)
filePath: "{{@Base64toFile.filePath}}"
folder: "Exports/{{@Webhook.year}}"
→ End

In on-premise installations, the engine’s public URL must be specified manually since ENGINE_HOST may point to an internal address.

{
"base64_key": "pdf_base64",
"filename": "document_{{@Webhook.id}}",
"extension": ".pdf",
"base_url": "https://floogos.mycompany.com/api"
}

  • Files are created in a temporary directory scoped to the client (/temporal/cli_<id>/). They are not permanently stored — use Google Drive, AWS S3, or FTP nodes to persist them.
  • The download URL is valid as long as the temporary file exists on the server (typically cleared after workflow execution or by a scheduled cleanup).
  • If the base64_key field is not found in the input data, the node throws an error. Use the exact field name returned by the previous node.
  • The base64 string can include or omit the data URI prefix (data:application/pdf;base64,...) — both formats are handled automatically.