# How to upload a file to an object storage bucket

Source: https://docs.quake.ai/docs/object/how-to/upload-file
Markdown: https://docs.quake.ai/docs/object/how-to/upload-file.md

---

# How to upload a file to an object storage bucket

Upload a file to a bucket (container) in Quake AI Object Storage. The file becomes an object addressable by its key (the path within the bucket).

<PrerequisiteBlock methods={["console", "cli", "api"]}>

- An existing object storage bucket: see [Create an object storage bucket](/docs/object/how-to/create-container)
- For S3-compatible CLI and API: [S3 credentials](/docs/object/how-to/create-s3-credentials) configured

</PrerequisiteBlock>

## Upload a file

<MethodTabs>
<Method label="Console">

1. Go to **Storage** > **Object Storage**.
2. Select the bucket to upload the file into.
3. Optionally navigate into a folder.
4. Select **Upload File** in the bucket toolbar. The **Upload File** dialog opens with a read-only **Bucket Name** field that confirms the target bucket.
5. Select **Click to Upload** next to the `* Select File` field and choose the local file.
6. Select **OK** in the dialog footer to start the upload.

</Method>
<Method label="CLI">




The `--name` flag sets the object key. Without it, the OpenStack client uses the full local path as the key.

```bash
openstack object create my-bucket /path/to/file.txt --name file.txt
```

Upload to a folder prefix:

```bash
openstack object create my-bucket /path/to/file.txt --name uploads/2026/file.txt
```




Using `s3cmd`:

```bash
s3cmd put /path/to/file.txt s3://my-bucket/file.txt
```

Upload to a folder prefix:

```bash
s3cmd put /path/to/file.txt s3://my-bucket/uploads/2026/file.txt
```

Using the AWS CLI:

```bash
aws s3 cp /path/to/file.txt s3://my-bucket/file.txt \
  --endpoint-url "https://object.${OS_REGION_NAME}.rumble.cloud"
```




</Method>
<Method label="API">

<ObjectApiEnvironment />

Using the Swift API:

```bash
curl -X PUT "$OS_SWIFT_URL/my-bucket/file.txt" \
  -H "X-Auth-Token: $OS_TOKEN" \
  -T /path/to/file.txt
```

Using the S3-compatible API:

```bash
aws s3api put-object \
  --bucket my-bucket \
  --key file.txt \
  --body /path/to/file.txt \
  --endpoint-url "$OS_SWIFT_S3_URL"
```




Upload a file using `boto3`:

```python
import boto3
from botocore.exceptions import ClientError

s3 = boto3.client(
    "s3",
    endpoint_url="YOUR_S3_ENDPOINT",
    aws_access_key_id="YOUR_ACCESS_KEY",
    aws_secret_access_key="YOUR_SECRET_KEY",
)

# Upload from a file path
s3.upload_file("local-file.txt", "my-bucket", "file.txt")

# Upload with put_object for in-memory data
s3.put_object(
    Bucket="my-bucket",
    Key="uploads/2026/file.txt",
    Body=b"file content here",
)
```

Upload with error handling:

```python
try:
    s3.upload_file("local-file.txt", "my-bucket", "file.txt")
    print("Upload complete")
except ClientError as e:
    print(f"Upload failed: {e.response['Error']['Message']}")
except FileNotFoundError:
    print("Local file not found")
```




</Method>
</MethodTabs>

## Verify the upload

<MethodTabs>
<Method label="Console">

After the upload completes, the bucket file list shows the file. Select it to view details, preview, or download.

</Method>
<Method label="CLI">




```bash
openstack object show my-bucket file.txt
```




```bash
s3cmd info s3://my-bucket/file.txt
```




</Method>
<Method label="API">

```bash
curl -I "$OS_SWIFT_URL/my-bucket/file.txt" \
  -H "X-Auth-Token: $OS_TOKEN"
```

A `200 OK` response confirms the object exists. The response headers include the file size and content type.

</Method>
</MethodTabs>

## See also

- [Create an object storage bucket](/docs/object/how-to/create-container)
- [Create a folder](/docs/object/how-to/create-folder)
- [Access an uploaded file](/docs/object/how-to/access-uploaded-file)
- [Object storage console reference](/reference/object-storage/console/object-storage)
