---
title: "Error: &#8220;Unable to copy file&#8221; when sending an export to an FTP or SFTP server"
date: 2026-12-01
updated: 2026-12-01
author: "Rafael Bennemann"
link: "https://www.gravitykit.com/docs/gravityexport/ftp-unable-to-copy-file/"
category: "GravityExport"
---

A GravityExport Save feed that sends its file to an FTP or SFTP server shows `Unable to copy file from local://… to target://…` when a step of sending the file to the server fails. The message names the file but not the step. This guide shows how to find the cause, first with **Test Connection** and then in the folder on the server.

## What the error looks like

After you click **Export Now** on the feed list, the message appears in a red notice above the list, and the feed's **Last Run** column says **Failed**. On the feed's **Activity Log** tab, a red alert names the most recent export that failed, and the table lists the run as `Failed: Unable to copy file from local://… to target://…`.

![The Activity Log tab of a GravityExport Save feed. A red alert reads "The most recent export, on December 1, 2026 @ 1:55 pm, failed: Unable to copy file from local://volunteer-roster-2026-12-01.csv to target://volunteer-roster-2026-12-01.csv", and the table below lists that failed run above an earlier run that exported 5 rows.](https://www.gravitykit.com/wp-content/uploads/2026/12/gravityexport-activity-log-unable-to-copy-file.png)
`local://` is the export file on your WordPress site, and `target://` is the name it gets in the **Remote Path** folder on the server. A scheduled feed with[failure alerts](https://www.gravitykit.com/docs/gravityexport/how-to-schedule-automated-exports/#get-an-email-when-a-scheduled-export-fails) turned on shows the same message in its dashboard notice and its email.

---

## Check 1: Test Connection

- In your WordPress admin, go to **Forms**, hover over your form and click **Settings**.
- Open the **GravityExport Save** tab, hover over the feed and click **Edit**.
- Open the **Storage** tab and click **Test Connection** at the bottom.

**Test Connection** signs in with the values on the page and writes a small test file to the **Remote Path** folder. It uses the values as they are on the page, saved or not, while exports use the saved settings. Click **Save Settings** after you change anything, so the two match.

What the test says points to the next step:

- "Your connection is properly configured." The sign-in works. A passing test doesn't prove that an export works, for example when **Remote Path** has form or field merge tags, so go to check 2.
- "Unable to connect or log in. Please ensure that the host/port and your username/password are correct." Check **Address**, **Port**, **Username** and **Password** with whoever manages the server. If the site moved to a new host recently, see [After moving your site to a new host](#after-moving-your-site-to-a-new-host).
- "Unable to save file. Please ensure that the destination folder exists and that you have write permissions." Check the folder as [The Remote Path folder](#the-remote-path-folder) describes.
- "Unable to delete file. Please ensure that you have the correct permissions." on a feed set to **FTP (Insecure)** or **FTP + SSL**. The server didn't let the account delete the test file, which stays in the folder. Exports don't delete files on the server, so go to check 2.
- "We could not perform the connection test due to a network or server error." on a feed set to **FTP (Insecure)** or **FTP + SSL**. These two options need PHP's FTP extension on your web server. Without it, Test Connection shows this message, and each export records `Failed: Undefined constant "FTP_BINARY"` in the **Activity Log**. Ask your web host to turn on the FTP extension, or choose **SFTP** if your server offers it.

---

## Check 2: Look for the file on the server

Click **Export Now** on the feed list, as [How to re-run a GravityExport Save feed](https://www.gravitykit.com/docs/gravityexport/reprocess-gravityexport-feed/) shows, and read the result on the feed's **Activity Log** tab. Then open the **Remote Path** folder on the server, with an FTP program such as FileZilla or the file manager your host provides. What you find there tells you which step failed.

Files whose names start with `gravityexport-save-connection-test-` and end in `.tmp` are test files left by **Test Connection**. You can delete them.

### The file is there, with the time of the failed export

Open the file. If it opens and holds every entry it should, the upload worked and the server refused the next step: right after each upload, GravityExport sets the file's permissions. Ask whoever manages the server to let this account change the permissions of the files it uploads.

If the file doesn't open or is cut short, the upload itself stopped. Ask whoever manages the server for its log at the time of the failed export.

### An older file with the same name is there, unchanged

The most likely cause is a server that doesn't let the account replace a file. The preset file names of an **All Entries** feed hold the date but not the time, such as `gravityexport-30-Volunteer-sign-ups-2026-10-30.xlsx`, so a second export on the same day writes to the same name.

To add the time to the name:

- On the feed's **File Settings** tab, choose **Custom Filename** under **Filename Format**.
- In the **Custom Filename** box, enter a name with `{DATE}` or `{TIMESTAMP}`, such as `volunteer-roster-{DATE}`. Both add the export's date and time, so the name looks like `volunteer-roster-2026-12-01T1346590000.csv`.
- Click **Save Settings**.

![The File Settings tab of a GravityExport Save feed with Custom Filename chosen under Filename Format. The Custom Filename box below the list of date merge tags holds volunteer-roster-{DATE} and is outlined in red, with an arrow pointing at it.](https://www.gravitykit.com/wp-content/uploads/2026/12/gravityexport-custom-filename-date.png)
*If the file has to keep the same name each time, ask whoever manages the server to let this account replace its files instead. If the export still fails with a new name, follow*[No file is there](#no-file-is-there).

### No file is there

Check the folder as [The Remote Path folder](#the-remote-path-folder) describes. If the folder is right, ask whoever manages the server for its log at the time of the failed export, which can show the step the server refused.

If the server's log shows no attempt to upload the file, ask your web host to check your site's temporary folder. GravityExport writes the export file there first and reads it back to send it, and a file it can't read never reaches the server.

---

## The Remote Path folder

**Remote Path** is the folder the file goes to, as an absolute path such as `/upload/`. Check it against the server:

- Some servers let an account add files only in one folder, such as `/upload/`, and not in its top folder `/`. Ask whoever manages the server which folder this account can write to.
- Over **SFTP**, an export creates a **Remote Path** folder that doesn't exist yet, if the server lets the account create folders there. Over **FTP (Insecure)** and **FTP + SSL**, create the folder on the server before the first export.
- If **Test Connection** says "Unable to save file.", check the path letter by letter and check that the account can add files and create folders there. Then run **Export Now** and look at the result in the **Activity Log** and in the folder.
- Merge tags work in **Remote Path**. With `/reports/{YYYY}/`, the files of 2026 go to a `/reports/2026/` folder.
- GravityExport changes folder names in **Remote Path** the same way it changes file names: spaces become hyphens, and symbols such as `&`, `#`, `(` and `)` are removed. A **Remote Path** of `/reports/Daily Reports/` writes to `/reports/Daily-Reports/`. Name the folder on the server with letters, numbers, `-` and `_` only.

---

## After moving your site to a new host

GravityExport encrypts the saved **Password** and **Private Key Passphrase** with a key made from the `AUTH_SALT` value in your site's `wp-config.php` file. If the new host gave the site new salts, the saved values can no longer be read, and the feed can't sign in. The **Password** field still shows a row of dots, so the page looks the same as before.

To fix it, on each feed that sends files over FTP or SFTP:

- Open the feed's **Storage** tab.
- Clear the **Password** field and type the password again. If the feed signs in with a key, type the **Private Key Passphrase** again too.
- Click **Save Settings**.

![The FTP Storage Configuration settings of a GravityExport Save feed with SFTP selected. The Password field, filled with dots, is outlined in red with an arrow pointing at it, between Private Key Passphrase and Remote Path.](https://www.gravitykit.com/wp-content/uploads/2026/12/gravityexport-ftp-password-field.png)
*[Connecting FTP to GravityExport](https://www.gravitykit.com/docs/gravityexport/connecting-ftp-to-gravityexport/) covers each FTP setting*