> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Filesystem: Copy a file

> Copies a file to a specified destination.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Copies a file from one location to another, leaving the original in place. Use this when you want to keep a file where it is but also place a copy somewhere else, for example duplicating an incoming order file into an archive folder, or copying an image to a second filesystem connection. The copy can go to a different directory, a different file name, or even a completely different connection. The data passing through is left unchanged, so this step is purely an action on files.

This documentation describes: [Schema](/schemas/transformer/filesystem-copy-file)

## Fields

<FormField property="sourceFilesystem" label="Source filesystem connection" required diType="filesystem">
  The filesystem connection that holds the file you want to copy.
</FormField>

<FormField property="path" label="Path of the file" required>
  The location of the file to copy on the source connection, including the file name and extension, for example `inbox/order-1042.csv`. You can use [placeholders](/references/placeholders) here to build the path from the data, such as `inbox/&{order.id}.csv`.
</FormField>

<FormField property="destinationFilesystem" label="Destination filesystem connection" diType="filesystem">
  The filesystem connection the copy should be written to. Leave it empty to copy within the source connection.
</FormField>

<FormField property="destinationDirectory" label="Destination directory">
  The folder the copy should be placed in. Leave it empty to copy to the root of the destination connection. You can use [placeholders](/references/placeholders) here to route files into folders based on the data.
</FormField>

<FormField property="destinationFilename" label="Destination filename">
  The name to give the copy, including its extension. Leave it empty to keep the original file name. You can use [placeholders](/references/placeholders) here too.
</FormField>

<FormField property="onExists" label="When the destination exists">
  What to do when a file with the same name already exists at the destination. Choose Skip to leave the existing file untouched and do nothing (the default), Overwrite to replace it, or Rename to keep both by giving the copy a new name. When you choose Rename, a Rename strategy field appears so you can pick how the new name is generated.
</FormField>

<FormField property="ensureDestination" label="Rename strategy" diType="filesystem-ensure-destination">
  Only shown when "When the destination exists" is set to Rename. The way a new file name is generated so the copy does not overwrite the existing file, for example by adding an increasing number to the name.
</FormField>

## Sample data

This step copies a file rather than transforming the data, so there is no before/after to show. The configuration below copies an incoming order file into an archive folder on the same connection, replacing any file already there.

| Field                        | Value                                    |
| ---------------------------- | ---------------------------------------- |
| Source filesystem connection | The connection holding the incoming file |
| Path of the file             | `inbox/order-1042.csv`                   |
| Destination directory        | `archive/2026/06`                        |
| When the destination exists  | Overwrite                                |

```json Configuration theme={null}
{
  "prototype": "filesystem-copy-file",
  "parameters": {
    "sourceFilesystem": "import-files",
    "path": "inbox/order-1042.csv",
    "destinationDirectory": "archive/2026/06",
    "onExists": "overwrite"
  }
}
```
