mirror of
https://github.com/minio/docs.git
synced 2025-09-10 20:12:12 +03:00
Updates for mc release 2024-06-20T14-50-54Z - Adds info about requiring Raw Base64 or Hex keys - Updates links for KES docs on encryption pages - Updates encryption pages to use ventilated prose (one sentence per line) - Adds new flag for `mc get` - Updates `mc put` with enc-# flags Closes #1253
148 lines
4.1 KiB
ReStructuredText
148 lines
4.1 KiB
ReStructuredText
==========
|
|
``mc put``
|
|
==========
|
|
|
|
.. default-domain:: minio
|
|
|
|
.. contents:: Table of Contents
|
|
:local:
|
|
:depth: 2
|
|
|
|
.. mc:: mc put
|
|
|
|
.. versionadded:: mc RELEASE.2024-02-24T01-33-20Z
|
|
|
|
Syntax
|
|
------
|
|
|
|
.. start-mc-put-desc
|
|
|
|
The :mc:`mc put` uploads an object from the local file system to a bucket on a target S3 deployment.
|
|
|
|
.. end-mc-put-desc
|
|
|
|
``mc put`` provides a simplified interface for uploading files compared to :mc:`mc cp` or :mc:`mc mirror`.
|
|
``mc put`` uses a one-way upload function that trades efficiency for the power and complexity of the other commands.
|
|
|
|
|
|
.. tab-set::
|
|
|
|
.. tab-item:: EXAMPLE
|
|
|
|
The following uploads the file ``logo.png`` from the local file system at path ``~/images/collateral/`` to a bucket called ``marketing`` on the MinIO deployment with the alias of ``minio``.
|
|
|
|
.. code-block:: shell
|
|
:class: copyable
|
|
|
|
mc put ~/images/collateral/logo.png minio/marketing
|
|
|
|
|
|
.. tab-item:: SYNTAX
|
|
|
|
The command has the following syntax:
|
|
|
|
.. code-block:: shell
|
|
:class: copyable
|
|
|
|
mc [GLOBALFLAGS] put \
|
|
TARGET \
|
|
[--enc-c value] \
|
|
[--enc-kms value] \
|
|
[--enc-s3 value] \
|
|
[--if-not-exists] \
|
|
[--parallel, -P integer] \
|
|
[--part-size, -s string]
|
|
|
|
.. include:: /includes/common-minio-mc.rst
|
|
:start-after: start-minio-syntax
|
|
:end-before: end-minio-syntax
|
|
|
|
Parameters
|
|
~~~~~~~~~~
|
|
|
|
.. mc-cmd:: TARGET
|
|
:required:
|
|
|
|
The full path to the :ref:`alias <minio-mc-alias>` or prefix where the command should run.
|
|
The TARGET *must* contain an :ref:`alias <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``
|
|
|
|
.. mc-cmd:: --enc-c
|
|
:optional:
|
|
|
|
Encrypt or decrypt objects using client provided keys.
|
|
Repeat the flag to pass multiple keys.
|
|
|
|
Keys must be in either Raw Base64 or Hex format.
|
|
|
|
.. mc-cmd:: --enc-kms
|
|
:optional:
|
|
|
|
Encrypt or decrypt objects using specific server-side keys.
|
|
Repeat the flag to pass multiple keys.
|
|
|
|
Defaults to the value in the ``MC_ENC_KMS`` environment variable.
|
|
|
|
.. mc-cmd:: --enc-s3
|
|
:optional:
|
|
|
|
Encrypt or decrypt objects using default server-side keys and configurations.
|
|
Repeat the flag to pass multiple keys.
|
|
|
|
Defaults to the value in the ``MC_ENC_S3`` environment variable.
|
|
|
|
.. mc-cmd:: --parallel, --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``.
|
|
|
|
.. mc-cmd:: --part-size, -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
|
|
~~~~~~~~~~~~
|
|
|
|
.. include:: /includes/common-minio-mc.rst
|
|
:start-after: start-minio-mc-globals
|
|
:end-before: end-minio-mc-globals
|
|
|
|
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``.
|
|
|
|
.. code-block:: shell
|
|
:class: copyable
|
|
|
|
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.
|
|
|
|
.. code-block:: shell
|
|
:class: copyable
|
|
|
|
mc put ~/videos/collateral/splash-page.mp4 minio/business --parallel 8 --part-size 20MiB
|