[io.stream.save-file]

io.stream.save-file is a slot in the io namespace, in Hyperlambda, the language of Magic Cloud. Writes a stream’s contents to disk under the given path; commonly used after uploads or [http.get] downloads.

  • Value (file-path), required: File path to save the stream to

Arguments

Required arguments come first, then the optional ones in the order they are declared.

Argument Type Required Description
any node name Stream yes Child node yielding the stream to save.
[overwrite] bool no Whether an existing file should be overwritten. Default: true.

Guide: How to use [io.stream.save-file]

JSON declaration

This is the complete declaration of io.stream.save-file, as the running system describes it. It is also published as slot.json.

JSON declaration
{
  "name": "io.stream.save-file",
  "description": "Writes a stream's contents to disk under the given path; commonly used after uploads or [http.get] downloads",
  "signature": {
    "input": {
      "kind": "file-path",
      "description": "File path to save the stream to",
      "required": true,
      "mode": "ValueOrExpression"
    },
    "children": {
      "overwrite": {
        "type": "bool",
        "kind": "boolean",
        "description": "Whether an existing file should be overwritten",
        "required": false,
        "mode": "ValueOrExpression",
        "cardinality": "ZeroOrOne",
        "default": "true"
      },
      "*": {
        "type": "Stream",
        "kind": "stream",
        "description": "Child node yielding the stream to save",
        "required": true,
        "mode": "ExecutableLambda",
        "cardinality": "ExactlyOne"
      }
    }
  }
}

← io.stream.read all io.* slots