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/BUCKETALIAS/BUCKET/PREFIXALIAS/BUCKET/OBJECT-NAMEALIAS/BUCKET/PREFIX/OBJECT-NAME
--checksum
Optional
Add a checksum to an uploaded object.
Valid values are:
MD5CRC32CRC32CSHA1SHA256
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 createreference for creating data keys.
For example:
--enc-kms "myaistor/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 "myaistor/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 "myaistor/mybucket/prefix/object.obj"
You can specify the parameter multiple times to denote different object(s) to encrypt:
--enc-s3 "myaistor/mybucket/foo/fooobject.obj" --enc-s3 "myaistor/mybucket/bar/barobject.obj"
Specify the path to a prefix to apply encryption to all matching objects at that path:
--enc-s3 "myaistor/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 "myaistor/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 "myaistor/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.
--storage-class
Alias: -sc
Optional
Set the storage class for the uploaded object.
See Erasure Coding settings for more about storage classes.
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 aistor deployment, uploading it on the destination as company-logo.png.
mc put images/collateral/logo.png aistor/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 aistor/business --parallel 8 --part-size 20MiB