# Remove File

### Overview

The **Remove File Component** removes a specified file from the database using its unique file ID. This ensures that unwanted or obsolete files are deleted efficiently from the system.

### Usage

This component is used when a file needs to be permanently removed from the database, ensuring storage optimization and compliance with data retention policies.

#### Properties

| Property | Type     | Description                                      |
| -------- | -------- | ------------------------------------------------ |
| `fileId` | `string` | The unique identifier of the file to be deleted. |

#### Input Ports

| Port | Description                                    |
| ---- | ---------------------------------------------- |
| `in` | Accepts the file ID of the file to be removed. |

#### Output Ports

| Port      | Description                                          |
| --------- | ---------------------------------------------------- |
| `deleted` | Emits the `fileId` of the successfully deleted file. |

#### Processing Logic

1. **Receives Input Data**:
   * Accepts a `fileId` that identifies the file to be deleted.
2. **Deletes the File**:
   * Locates the file in the database.
   * Removes the file permanently.
3. **Confirms Deletion**:
   * Emits the `fileId` of the deleted file as confirmation.
   * If an error occurs (e.g., file not found), it is logged or raised appropriately.

#### Output Data Schema

| Property | Type     | Description                         |
| -------- | -------- | ----------------------------------- |
| `fileId` | `string` | The identifier of the deleted file. |

### Notes

* **Permanent Deletion**: Once removed, the file cannot be recovered.
* **Efficient Storage Management**: Helps free up space in the database.
* **Error Handling**: Ensures errors are logged when deletion fails.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appmixer.com/connector-configuration/utils/files/remove-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
