1
0
mirror of https://github.com/minio/docs.git synced 2025-08-06 14:42:56 +03:00
Files
docs/source/reference/minio-mc/mc-put.rst
Daryl White 8ad71d4a5b Updates for mc RELEASE.2024-10-02T08-27-28Z (#1339)
- Adds a `--checksum` flag to `mc cp`, `mc mirror`, `mc pipe`, and `mc
put`
- Adds `--disable-multipart` to `mc put`
- Adds alias name to outputs of `mc ready`
- Adds flags to `mc admin heal`

Closes #1334
2024-10-04 13:56:07 -04:00

4.2 KiB

mc put

minio

Table of Contents

mc put

mc RELEASE.2024-02-24T01-33-20Z

Syntax

The mc put uploads an object from the local file system to a bucket on a target S3 deployment.

mc put provides a simplified interface for uploading files compared to mc cp or mc mirror. mc put uses a one-way upload function that trades efficiency for the power and complexity of the other commands.

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.

mc put ~/images/collateral/logo.png minio/marketing

SYNTAX

The command has the following syntax:

mc [GLOBALFLAGS] put                      \
                 TARGET                   \
                 [--checksum value]       \
                 [--disable-multipart]    \
                 [--enc-kms value]        \
                 [--enc-s3 value]         \
                 [--enc-c value]          \
                 [--if-not-exists]        \
                 [--parallel, -P integer] \
                 [--part-size, -s string]

Parameters

TARGET

The full path to the alias <minio-mc-alias> or prefix where the command should run. The TARGET must contain an 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

--checksum

RELEASE.2024-10-02T08-27-28Z

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 MinIO targets.

--disable-multipart

RELEASE.2024-10-02T08-27-28Z

Disables multipart uploads and directs mc to send the object in a single PUT operation.

--parallel, --P

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, -s

Specify the size to use for each part of a multi-part upload.

If not defined, defaults to a value of 16MiB.

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