FlowmageDocs

Save a file

Changes dataVersion 2

Saves data from the flow as a file in storage, or as a new version of one.

Settings

SettingWhat it is
File nameRequiredA 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.
ContentText or base64 per the encoding; expressions welcome. Empty writes a 0-byte file.
EncodingPick 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 typeOnly for a NEW file — the type is fixed across versions after that. Left empty it is detected from the content, then from the name.
FolderThe 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
KeyValue
nametext
contenttext
encoding"text" or "base64", by default "text"
contentTypetext
folderIdtexta Storage folder id, or empty for unfiled

Output

FieldType
nameFile namestring
fileIdstring
contentTypestring
sizeSize (bytes)number
sha256SHA-256 of the contentstring
kindResult — created, versioned or noopstring
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
SettingWhat it is
File nameRequiredA 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.
ContentText or base64 per the encoding; expressions welcome. Empty writes a 0-byte file.
EncodingPick 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 typeOnly 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
KeyValue
nametext
contenttext
encoding"text" or "base64", by default "text"
contentTypetext