# Upload Objects

When you upload a file to <code class="expression">space.vars.ionos\_cloud\_object\_storage</code>, it is stored as an Object and can be stored in buckets and folders in the Object Storage.

## DCD

To upload objects to buckets, follow these steps:

{% hint style="info" %}
**Prerequisites:**

* Make sure a bucket already exists to which you want to upload objects (files).
* If you want to use object lock, then make sure the object lock is enabled for the bucket as well. For more information, see [<mark style="color:blue;">Object Lock</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/ionos-object-storage/settings/object-lock).
  {% endhint %}

1\. In the **DCD**, go to **Menu** > **Storage & Backup** > **IONOS Object Storage**.

2\. From the drop-down list in the **Buckets** tab, choose either **Show user-owned buckets** or **Show contract-owned buckets** depending on the bucket type you want to view.

3\. From the **Buckets** list, choose the bucket to which objects must be uploaded.

4\. Click **Upload objects** which opens an overlay screen.

5\. Click **Browse files** or drag and drop the files to be uploaded. You can choose to upload multiple files.

![Browse files to upload](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-6489987014bf93e6d54a2cffab2b923bc5a830a0%2Fs3-upload-objects-browse-files.png?alt=media)

{% hint style="info" %}
**Info:** During object upload, you can turn on or off Server-Side Encryption with Object Storage Managed Keys (SSE-S3) for user-owned buckets. The object upload via DCD does not support encryption for contract-owned buckets.
{% endhint %}

5\. Review the selected files to be uploaded. Use the **Remove** and **Remove all** options to remove any files from being uploaded.

6\. Click **Start upload** to confirm the files to be uploaded.

![Upload objects](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-cbdeb401c7d18b8dde5815905a2353c45a2aff55%2Fs3-upload-objects.png?alt=media)

{% hint style="success" %}
**Result:** The objects are successfully uploaded to the selected bucket.
{% endhint %}

### Limitations

A few of the limitations to consider while using object upload through the DCD are:

* A maximum of 4,65 GiB upload size for a single object applies.
* Due to the upload size limit, multi-part uploads are not supported.
* The Server-side Encryption with Customer Provided Keys (SSE-C) is not supported.

Other applications or the [<mark style="color:blue;">SDKs and APIs</mark>](#api) are not subject to these limitations.

## API

Using the [<mark style="color:blue;">Object Storage API</mark>](https://api.ionos.com/docs/s3/v2/#tag/Basic-Operations), you can perform object upload and manage objects in a bucket.

{% hint style="info" %}
**Note:** Only a single storage class is currently available: `STANDARD`. It is designed for general-purpose storage of frequently accessed data.
{% endhint %}

## CLI

{% hint style="info" %}
**Prerequisites:**

* Set up the AWS CLI by following the [<mark style="color:blue;">installation instructions</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/ionos-object-storage/s3-tools/awscli).
* Make sure to consider the supported [<mark style="color:blue;">Endpoints</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/ionos-object-storage/endpoints) for object upload.
  {% endhint %}

**To upload an object from the current directory to a bucket:**

```
aws s3 cp filename.txt s3://my-bucket --endpoint-url https://s3-eu-central-2.ionoscloud.com
```

**To copy the contents of the local directory `my-dir` to the bucket `my-bucket`:**

```
aws s3 cp my-dir s3://my-bucket/ --recursive --endpoint-url https://s3-eu-central-2.ionoscloud.com
```

**To copy all objects from `my-source-bucket` to `my-dest-bucket`, excluding `.zip` files:**

```
aws s3 cp s3://my-source-bucket/ s3://my-dest-bucket/ --recursive --exclude "*.zip" --endpoint-url https://s3.eu-central-2.ionoscloud.com
```

{% hint style="info" %}
**Info:** This command does not support cross-region copying for <code class="expression">space.vars.ionos\_cloud\_object\_storage</code>.
{% endhint %}

**To sync the bucket `my-bucket` with the contents of the local directory `my-dir`:**

```
aws s3 sync my-dir s3://my-bucket --endpoint-url https://s3.eu-central-2.ionoscloud.com
```

## Multi-part upload

You can upload and copy objects using the multi-part upload feature that allows you to break down a single object into smaller parts and upload these object parts in parallel, maximizing the upload speed. The [<mark style="color:blue;">Object Storage API</mark>](https://api.ionos.com/docs/s3/v2/#tag/Uploads/operation/CreateMultipartUpload) and many [<mark style="color:blue;">S3 Tools</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/ionos-object-storage/s3-tools) offer this functionality, allowing users to take advantage of efficiency through parallel uploads.
