Zebflow Docs
fs.file.copy
Zebflow Docs

fs.file.copy

Copies a file to another key or store

fs.file.copy --from FILE [--store TEXT] [--folder TEXT] [--filename TEXT] [--path TEXT] [--on-conflict error|skip|overwrite] → file

Copies a file to another key or store. Copy the file --from names — a FileRef from any store, an upload, or a store key — to --folder (keeps the name), --filename, or an exact --path, in the node's --store. An existing destination is an error unless --on-conflict says otherwise. Adds file, the durable FileRef of the copy (origin: fs.file.copy), and keeps the rest of the payload. A copy is private like any file until the owner exposes its folder in Studio → Files.

Flags

  • --from (required): The file: a FileRef, an upload or a store key.
  • --store: The store to write to: local, or the id of an s3 credential; a bare --from key is read from it too. Saved explicitly when the pipeline is registered.
  • --folder: Destination folder (default: the source's folder).
  • --filename: Destination name (default: the source's name).
  • --path: Exact destination key; overrides --folder and --filename.
  • --on-conflict: When the target already exists: overwrite, skip or error (default: error)

Examples

Keep a copy of an upload

| fs.file.copy --from "{{ input.file }}" --folder images

Input:

json
{  "file": {    "__zf_type": "file_ref",    "backend": "zebfs",    "store": "local",    "ref": "uploads/a1.jpg",    "filename": "a1.jpg",    "mime": "image/jpeg",    "kind": "image",    "size": 1723,    "sha256": "sha256:…",    "lifecycle": "durable",    "origin": "fs.file.put",    "trust": "generated"  }}

It answers:

json
{  "file": {    "__zf_type": "file_ref",    "backend": "zebfs",    "store": "local",    "ref": "images/a1.jpg",    "filename": "a1.jpg",    "mime": "image/jpeg",    "kind": "image",    "size": 1723,    "sha256": "sha256:…",    "lifecycle": "durable",    "origin": "fs.file.copy",    "trust": "generated"  }}