Save a file
Changes dataVersion 2
Saves data from the flow as a file in storage, or as a new version of one.
Settings
| Setting | What it is |
|---|---|
| File nameRequired | A file's name is the whole key — exports/report.csv is a name, not a folder. A name that already exists gets a new version — the last 10 are kept. |
| Content | Text or base64 per the encoding; expressions welcome. Empty writes a 0-byte file. |
| Encoding | Pick Base64 for bytes — an image, a PDF, anything HTTP Request returned as Base64. Base64 content must be valid base64, or the write fails. One version is at most 100 MB. |
| Content type | Only for a NEW file — the type is fixed across versions after that. Left empty it is detected from the content, then from the name. |
| Folder | The Storage folder a new file goes in. A new version stays wherever its file is, and a folder deleted since means the file lands unfiled. |
Technical details
| Key | Value |
|---|---|
name | text |
content | text |
encoding | "text" or "base64", by default "text" |
contentType | text |
folderId | texta Storage folder id, or empty for unfiled |
Output
| Field | Type |
|---|---|
nameFile name | string |
fileId | string |
contentType | string |
sizeSize (bytes) | number |
sha256SHA-256 of the content | string |
kindResult — created, versioned or noop | string |
versionNumberVersion number (absent on a no-op write) | number |
Sample output, and the expression for each field
- contentType"text/plain"
- fileId"file_1"
- kind"created"
- name"a.txt"
- sha256"sha_5"
- size5
- versionNumber1
Errors
When a step of this node stops a run, the run page shows a code. Look it up:
Example step
The step as a flow file holds it. Replace each value in <…>.
{
"config": {
"content": "",
"encoding": "text",
"name": "<file name>"
},
"label": "Save a file",
"type": "file.write",
"version": 2
}Older versions
A flow that already has this version keeps running it. A new step always gets the newest.
Version 1
| Setting | What it is |
|---|---|
| File nameRequired | A file's name is the whole key — exports/report.csv is a name, not a folder. A name that already exists gets a new version — the last 10 are kept. |
| Content | Text or base64 per the encoding; expressions welcome. Empty writes a 0-byte file. |
| Encoding | Pick Base64 for bytes — an image, a PDF, anything HTTP Request returned as Base64. Base64 content must be valid base64, or the write fails. One version is at most 100 MB. |
| Content type | Only for a NEW file — the type is fixed across versions after that. Left empty it is detected from the content, then from the name. |
Technical details
| Key | Value |
|---|---|
name | text |
content | text |
encoding | "text" or "base64", by default "text" |
contentType | text |