Base64 to File
Description
Section titled “Description”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.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| base64_key | text | No | Name of the input field containing the base64 string. Supports dot notation (e.g. document.pdf_base64). Default: pdf_base64 |
| filename | text | No | Output filename without extension. Supports dynamic variables: {{order_number}}, {{invoice_id}}, etc. Default: archivo |
| extension | select | No | File extension: .pdf, .png, .jpg, .xlsx, .zip, .xml, .json, .txt, .csv, .html. Default: .pdf |
| content_type | text | No | HTTP Content-Type override. If empty, auto-detected from the extension |
| base_url | text | No | Public engine URL for building the download link. Falls back to ENGINE_HOST env var. Required for on-premise deployments |
If the
filenamealready includes an extension (e.g.invoice.pdf), the separateextensionfield is ignored.
Output
Section titled “Output”{ "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}| Field | Description |
|---|---|
| filename | Final filename with extension |
| filePath | Absolute local path on the server |
| urlPath | Public download URL |
| contentType | MIME type of the generated file |
| size | File size in bytes |
Usage Examples
Section titled “Usage Examples”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}}" → EndExample 2 — Nested base64 field
Section titled “Example 2 — Nested base64 field”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}}" → EndExample 4 — On-premise deployment
Section titled “Example 4 — On-premise deployment”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_keyfield 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.
Related Nodes
Section titled “Related Nodes”- File Transfer — FTP/SFTP upload of the generated file
- AWS S3 — upload to Amazon S3
- Google Drive — upload to Google Drive
- SendMail — attach the file to an email
- File Rename — rename before further processing