copy

This block is part of the files group and was last modified in core v15.0.0.

copy v15.0.0

Copies the given files into a destination directory, keeping each file's original name. The destination directory is a folder path (created if missing), not a full path including the filename : e.g. /public/uploads copies hero.png to /public/uploads/hero.png. Place the directory under /public/… to make the copies publicly servable via /static/…. To rename the copy, set the optional filename pin (single source file only). To fan one file out to several full paths and/or names at once, use the file spread block instead.

In pins 4 + flow
  • flow
    flow
  • files required
    file
  • destination directory required
    value

    Folder to copy the file(s) into (created if it does not exist). This is a directory, not a full path : the file keeps its original name unless filename is set. Use /public/… for publicly servable copies.

  • filename v15.0.0
    value

    Optional. Renames the copied file (include the extension, e.g. hero.png). Only meaningful when copying a single file : with multiple input files they would all collide on the same name.

  • overwrite required v12.0.7
    condition

    Overwrites file at destination if it exists.

    Default true

Out pins 3 + flow
  • flow
    flow
  • success
    condition
  • error
    value
  • files
    file

A typical wiring for copy: concatenate values feeds the value pin; true feeds the overwrite pin; get file from assets feeds the file pin; the flow out pin feeds branch; the file out pin feeds get image size.

Studio canvas example for the copy block: typical wiring for copy.

Commonly used with

In production blueprints, this block is most often wired together with:

  • branch: this block feeds into it.
  • create: feeds into this block. Creates a new function that can be executed using the given name.
  • concatenate values: feeds into this block.
  • true: feeds into this block. Gives the condition true hard-coded.
  • get image size: this block feeds into it. Returns the dimensions of the image given.
  • get link: this block feeds into it. Returns the link of a given file which can be used as a img src. Will only work with public files.

Version history

Introduced in v15.0.0.

v12.0.7 This block or one of its pins was updated in v12.0.7, click here to see the release notes.
Back to files Return to the main group to view all sub-groups Back to file modification Return to the group to view all blocks within this group