---
title: "copy · RUAL Documentation"
description: "Copies the given files into a destination directory, keeping each file's original name. The destination directory is a folder path (created if missing),…"
canonical: https://docs.rual.nl/block-types/files/file_copy
language: en
---

# copy

This block is part of the [`files`](https://docs.rual.nl/block-types/files) group and was last modified in core [`v15.0.0`](https://docs.rual.nl/core-versions/150000).

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.

- 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`

- flow `flow`

- success `condition`

- error `value`

- files `file`

A typical wiring for [copy](https://docs.rual.nl/block-types/files/file_copy): [concatenate values](https://docs.rual.nl/block-types/value/value_concatenate) feeds the `value` pin; [true](https://docs.rual.nl/block-types/condition/condition_is_true) feeds the `overwrite` pin; [get file from assets](https://docs.rual.nl/block-types/files/file_from_assets) feeds the `file` pin; the `flow` out pin feeds [branch](https://docs.rual.nl/block-types/flow/branch); the `file` out pin feeds [get image size](https://docs.rual.nl/block-types/files/file_get_image_size).

![Studio canvas example for the copy block: typical wiring for copy.](https://docs.rual.nl/canvas-examples/file_copy.png)

### Commonly used with

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

- [branch](https://docs.rual.nl/block-types/flow/branch): this block feeds into it.

- [create](https://docs.rual.nl/block-types/globals/trigger_custom_function): feeds into this block. Creates a new function that can be executed using the given name.

- [concatenate values](https://docs.rual.nl/block-types/value/value_concatenate): feeds into this block.

- [true](https://docs.rual.nl/block-types/condition/condition_is_true): feeds into this block. Gives the condition true hard-coded.

- [get image size](https://docs.rual.nl/block-types/files/file_get_image_size): this block feeds into it. Returns the dimensions of the image given.

- [get link](https://docs.rual.nl/block-types/files/file_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`](https://docs.rual.nl/core-versions/150000).
