# DeleteSFTPFile

Description

Deletes files in the specified SFTP directory.

{% hint style="info" %}

* Ensure that you have a properly configured SFTP connection resource set up under the Resources folder.
* SFTP file names are typically case-sensitive; therefore, abc.JPG, abc.jpg, and ABC.jpg will be saved as different files. To ensure consistency, we recommend using lower-case file names and extensions: abc.jpg.
  {% endhint %}

## Configuration

| Field                      | Required | Description                                                                                                                                           | Example                                                  |
| -------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Name                       | Required | The name of the activity. This name must be unique in a workflow.                                                                                     | DeleteOldSalesReport                                     |
| Description                | Optional | The description of the activity. We recommend you make this as clear as possible to guide execution, foster understanding, and support collaboration. | Deletes the previous day's sales report from the server. |
| Resource                   | Required | A predefined connection resource for accessing SFTP data.                                                                                             | /Resources/SFTP Resources/SFTPConnection                 |
| SFTP Authorization Context | Optional | Defines how credentials are resolved at runtime. Options may include Default, Inherited, or custom contexts.                                          | Default                                                  |
| Directory                  | Optional | The target directory on the SFTP server where the file is located. Optional if full file path is provided.                                            | /reports/daily/                                          |
| File Path                  | Optional | The complete path to the file on the SFTP server. If provided, it overrides Directory + File Name.                                                    | /reports/daily/sales\_2024-05-15.csv                     |
| File Name                  | Optional | The name of the file to delete. Used with Directory when File Path is not set.                                                                        | sales\_2024-05-15.csv                                    |

<figure><img src="https://3150268419-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVvyIzXhljwsvkXUekYmw%2Fuploads%2Fr5VfL83tvUI8yP1u54dP%2FDeleteSFTPFile.png?alt=media&#x26;token=9595693d-33ab-4993-8d42-78fb9704e6bb" alt=""><figcaption></figcaption></figure>

## Input

| Field            | Required | Data Type | Description                                                                                                | Example                               |
| ---------------- | -------- | --------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| workingDirectory | Optional | String    | The target directory on the SFTP server where the file is located. Optional if full file path is provided. | `/reports/daily/`                     |
| filePath         | Optional | String    | The complete path to the file on the SFTP server. If provided, it overrides Directory + File Name.         | `/reports/daily/sales_2024-05-15.csv` |
| fileName         | Optional | String    | The name of the file to delete. Used with Directory when File Path is not set.                             | `sales_2024-05-15.csv`                |

## Output

| Field       | Required | Data Type | Description                                                         | Example                               |
| ----------- | -------- | --------- | ------------------------------------------------------------------- | ------------------------------------- |
| JSON Schema | Optional | NA        | A custom schema that can be imported.                               | NA                                    |
| Boolean     | Optional | Boolean   | Indicates whether the target file was deleted.                      | `true`                                |
| filePath    | Optional | String    | Indicates the complete path to the deleted file on the SFTP server. | `/reports/daily/sales_2024-05-15.csv` |
| fileName    | Optional | String    | The name of the deleted file.                                       | `sales_2024-05-15.csv`                |
