copyright | lastupdated | ||
---|---|---|---|
|
2017-02-23 |
{:new_window: target="_blank"} {:shortdesc: .shortdesc} {:codeblock: .codeblock} {:screen: .screen} {:pre: .pre}
You can upload objects to storage by using the UI or CLI. Uploading objects is limited to a maximum size of 5 GB in a single upload. However, you can upload larger objects by segmenting them into smaller objects. {: shortdesc}
Note: When you upload a file with the same name, {{site.data.keyword.objectstorageshort}} replaces the stored file with the new file. If you download a file and make edits, be sure to give the file another name, or set up object versioning before you upload to keep both versions of the file.
- From your service instance dashboard, add a container from the Actions drop-down menu.
- Name your container and click CREATE.
- From the Actions drop-down menu, select Add Files. A dialog box opens.
- Select the file, or files you want to upload and click Open.
- If you are not logged in to {{site.data.keyword.Bluemix_notm}}, log in to the org and space that contains your instance of {{site.data.keyword.objectstorageshort}}.
cf login -a api.ng.bluemix.net -u <userid> -p <password> -o <organization> -s <space>
{: pre}
- Create an {{site.data.keyword.objectstorageshort}} container by running the following command. The container_name variable is set, by you, now.
swift post <container_name>
{: pre}
Note: If you receive an error message, confirm that the the prerequisite software is installed.
- Optional: To verify that your container was created, run the following command to list your containers.
swift list
{: pre}
-
To prevent data destruction by unintentional over-writes, set up object versioning. If you do not want object versioning, list your existing files in the store, and if necessary, rename the directory or the files before you upload.
-
Upload a file to your container by running the following command.
swift upload <container_name> <file_name>
{: pre}
Note: To upload files larger than 5 GB extra steps are needed.
- Optional: To verify that upload was successful, view the content of your container by running the following command.
swift list <container_name>
{: pre}