Downloading an Object
On Compute Cloud@Customer, you can download an object using the CLI and API.
This task isn't available in the Console.
Use the oci os object get command and required parameters to download an object.
Syntax:
oci os object get --namespace-name <object_storage_namespace> --bucket-name <bucket_name> --name<object_name> --file<file_location> [OPTIONS]
<file_location> is the destination path for the file being downloaded, such as
C:\workspace\Downloads\MyFile.txt
or/home/user/Documents/Downloads/MyFile.txt
.Example:
oci os object get \ --namespace-name examplenamespace \ --bucket-name MyBucket \ --name photos \ --file /home/photos_backup Downloading object [#-----------------------------------] 100% # ls -l total 8 -rw-r--r-- 1 root root 1363 Jun 1 17:56 photo1 -rw-r--r-- 1 root root 1363 Jun 1 21:40 photo1_backup -rw-r--r-- 1 root root 0 Jun 1 20:42 photo2 -rw-r--r-- 1 root root 0 Jun 1 20:42 photo3 -rw-r--r-- 1 root root 0 Jun 1 20:42 photo4
For a complete list of CLI commands, flags, and options, see the Command Line Reference.
Use the GetObject operation to download an object.
For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.