mc put
The mc put
command uploads objects from a local filesystem to an AIStor deployment.
You can also use mc put
to upload objects to S3-compatible services.
Syntax
Parameters
TARGET
Required
The full path to the alias or prefix where the command should run.
The TARGET must contain an alias and bucket
name.
The TARGET may also contain the following optional components:
- PREFIX where the object should upload to
- OBJECT-NAME to use in place of the file names
Valid TARGETs could take any of the following forms:
ALIAS/BUCKET
ALIAS/BUCKET/PREFIX
ALIAS/BUCKET/OBJECT-NAME
ALIAS/BUCKET/PREFIX/OBJECT-NAME
--checksum
Optional
Add a checksum to an uploaded object.
Valid values are:
MD5
CRC32
CRC32C
SHA1
SHA256
The flag requires server trailing headers and works with AWS or AIStor targets.
--disable-multipart
Optional
Disables multipart uploads and directs mc
to send the object in a single PUT
operation.
--enc-kms
Encrypt or decrypt objects using server-side SSE-KMS encryption with client-managed keys.
The parameter accepts a key-value pair formatted as KEY=VALUE
KEY
- The full path to the object asalias/bucket/path/object.ext
. You can specify only the top-level path to use a single encryption key for all operations in that path.VALUE
- Specify an existing data key on the external KMS. See themc admin kms key create
reference for creating data keys.
For example:
--enc-kms "myminio/mybucket/prefix/object.obj=mybucketencryptionkey"
You can specify multiple encryption keys by repeating the parameter.
Specify the path to a prefix to apply encryption to all matching objects at that path:
--enc-kms "myminio/mybucket/prefix/=mybucketencryptionkey"
--enc-s3
Optional
Encrypt or decrypt objects using server-side SSE-S3 encryption with KMS-managed keys.
Specify the full path to the object as alias/bucket/prefix/object
.
For example:
--enc-s3 "myminio/mybucket/prefix/object.obj"
You can specify the parameter multiple times to denote different object(s) to encrypt:
--enc-s3 "myminio/mybucket/foo/fooobject.obj" --enc-s3 "myminio/mybucket/bar/barobject.obj"
Specify the path to a prefix to apply encryption to all matching objects at that path:
--enc-s3 "myminio/mybucket/foo"
--enc-c
Optional
Encrypt or decrypt objects using server-side SSE-C encryption with client-managed keys.
The parameter accepts a key-value pair formatted as KEY=VALUE
KEY
: The full path to the object asalias/bucket/path/object.ext
. You can specify only the top-level path to use a single encryption key for all operations in that path.VALUE
: Specify either a 32-byte RawBase64-encoded key or a 64-byte hex-encoded key for use with SSE-C encryption. Raw Base64 encoding rejects=
-padded keys. Omit the padding or use a Base64 encoder that supports RAW formatting.
For example:
# RawBase64-Encoded string "mybucket32byteencryptionkeyssec"
--enc-c "myminio/mybucket/prefix/object.obj=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
You can specify multiple encryption keys by repeating the parameter.
Specify the path to a prefix to apply encryption to all matching objects at that path:
--enc-c "myminio/mybucket/prefix/=bXlidWNrZXQzMmJ5dGVlbmNyeXB0aW9ua2V5c3NlYwo"
--parallel
Alias: --P
Optional
For multi-part uploads, specify the number of parts of the object to upload in parallel.
If not defined, defaults to a value of 4
.
--part-size
Alias: -s
Optional
Specify the size to use for each part of a multi-part upload.
If not defined, defaults to a value of 16MiB
.
Global Flags
This command supports any of the global flags.
Examples
Upload a File and Specify the Object Name
The following command uploads the file logo.png
from the local file system to the business
bucket on the minio
deployment, uploading it on the destination as company-logo.png
.
mc put images/collateral/logo.png minio/business/company-logo.png
Upload a Multipart Object in Parallel with a Specified Part Size
The following command uploads a file in chunks of 20MiB each and uploads 8 parts of the file in parallel. 8 parts are uploaded in succession until all parts of the object have uploaded.
mc put ~/videos/collateral/splash-page.mp4 minio/business --parallel 8 --part-size 20MiB