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

# Upload and Download OSS Objects Using ossctl

> Learn how to use the ossctl command line to upload, download, copy, and list OSS objects.

After configuring ossctl, you can use the command line to upload objects, download objects, batch-copy directories, or list objects in Buckets.

## Pre-Action Confirmation

* An OSS bucket has been created, and you have obtained permission to access it.
* Access Keys have been obtained, and ossctl has been configured.
* The current environment can access the OSS Endpoint in the Region where the bucket is located.

## Upload Objects

### Uploading a Single Object

Use the `put` command to upload a single object.

```bash theme={null}
./ossctl put <LOCAL_FILE> <CONFIGNAME>/<BUCKET>
```

Parameter description:

| Parameter | Description |
| - | - |
| `<LOCAL_FILE>` | Path to the local file to upload. |
| `<CONFIGNAME>` | Name of the local OSS access configuration. |
| `<BUCKET>` | Target Bucket Name. |

After the command is executed, you can list the objects in the target Buckets to confirm that the object has been created.

### Upload Directories in Batches

Use the `cp` command to recursively upload a directory.

```bash theme={null}
./ossctl cp -r <LOCAL_DIR> <CONFIGNAME>/<BUCKET>/
```

Parameter description:

| Parameter | Description |
| - | - |
| `<LOCAL_DIR>` | Path to the local directory to be uploaded. |
| `<CONFIGNAME>` | Name of the local OSS access configuration. |
| `<BUCKET>` | Name of the target bucket. |

After the command is executed, verify that the files in the directory have been uploaded to the target bucket and that the object paths are as expected.

## Download Objects

### Download a Single Object

Use the `get` command to download a single object.

```bash theme={null}
./ossctl get <CONFIGNAME>/<BUCKET>/<OBJECT_NAME> <LOCAL_FILE>
```

Parameter description:

| Parameter | Description |
| - | - |
| `<CONFIGNAME>` | Name of the local OSS access configuration. |
| `<BUCKET>` | Source bucket name. |
| `<OBJECT_NAME>` | Name or path of the object to download. |
| `<LOCAL_FILE>` | Local file path after download. |

After the command has finished executing, verify that the file has been generated in the local directory.

### Batch Download Directories

Use the `cp` command to recursively download a directory.

```bash theme={null}
./ossctl cp --recursive <CONFIGNAME>/<BUCKET>/<OBJECT_PATH> <LOCAL_DIR>
```

Parameter description:

| Parameter | Description |
| - | - |
| `<CONFIGNAME>` | Name of the local OSS access configuration. |
| `<BUCKET>` | Source bucket name. |
| `<OBJECT_PATH>` | Path of the object to download. |
| `<LOCAL_DIR>` | Path of the local directory to download to. |

After the command is executed, verify in the local directory that the file structure and number of files meet expectations.

## List objects

Use the `ls` command to list objects in Buckets.

```bash theme={null}
./ossctl ls <CONFIGNAME>/<BUCKET>
```

Parameter description:

| Parameter | Description |
| - | - |
| `<CONFIGNAME>` | Name of the local OSS access configuration. |
| `<BUCKET>` | Bucket Name to view. |

If uploading, downloading, or listing objects fails, first check the local path, object path, Bucket Name, Access Keys, bucket permissions, and network connectivity. If the issue persists, record the command, error message, and Bucket Name, and contact technical support.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.