# Manage connector files

Query, upload, preview, download, and delete files in the file space accessible through a connector. This page handles connector files only; to import database tables, see [Import tasks](import-data.md).

## Prerequisites

Prepare credentials that can access the target workspace and the target connector ID. For service endpoints, authentication, and general request formats, see [Prepare to call an API](../../api-call-basics.md).

If you have not created or validated a connector, first complete [Create and maintain connectors](connectors.md).

## Call sequence

1. List files first to identify the target file and its ID.
2. Preview a file to inspect its content. Download it to obtain complete content.
3. Upload a file to add content, then list files again to confirm that it is visible.
4. Delete a file only after confirming it is no longer needed.

## API operations

### Query and read files

| What you need to do | API operation | Use it when |
| --- | --- | --- |
| Query files | [List files](../../../../reference/api/ai-studio/data-connections/connector-files/list-files.md) | Locate a file or confirm the file set after upload or deletion. |
| Preview a file | [Preview a file](../../../../reference/api/ai-studio/data-connections/connector-files/preview-file.md) | Inspect file content before reading it. |
| Download a file | [Download a file](../../../../reference/api/ai-studio/data-connections/connector-files/download-file.md) | Obtain a file. |

### Write and delete files

| What you need to do | API operation | Use it when |
| --- | --- | --- |
| Upload a file | [Upload a file](../../../../reference/api/ai-studio/data-connections/connector-files/upload-file.md) | Add a file to the connector file space. |
| Delete a file | [Delete a file](../../../../reference/api/ai-studio/data-connections/connector-files/delete-file.md) | You confirmed that the file is no longer needed. |

## Confirm the result

After uploading or deleting, call [List files](../../../../reference/api/ai-studio/data-connections/connector-files/list-files.md) again to confirm the file set. Before reading, use [Preview a file](../../../../reference/api/ai-studio/data-connections/connector-files/preview-file.md) to confirm selected content.

## Limitations and notes

- Before deletion, confirm that later import tasks no longer use the target file.
- Preview and download use different read methods. The corresponding action pages define the readable scope.

## Next steps

- [Import tasks](import-data.md)
