From a5a54b4429d951ca651015dce18fc45b0f253d6b Mon Sep 17 00:00:00 2001 From: llchry <40153967+llchry@users.noreply.github.com> Date: Wed, 25 Sep 2024 01:47:33 +0800 Subject: [PATCH] put: Add --disable-multipart to make it easier to use. (#5041) --- cmd/put-main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/put-main.go b/cmd/put-main.go index 2bccc769..df889165 100644 --- a/cmd/put-main.go +++ b/cmd/put-main.go @@ -47,6 +47,10 @@ var ( Usage: "upload only if object does not exist", Hidden: true, }, + cli.BoolFlag{ + Name: "disable-multipart", + Usage: "disable multipart upload feature", + }, } ) @@ -116,6 +120,8 @@ func mainPut(cliCtx *cli.Context) (e error) { fatalIf(errInvalidArgument().Trace(strconv.Itoa(threads)), "Invalid number of threads") } + disableMultipart := cliCtx.Bool("disable-multipart") + // Parse encryption keys per command. encryptionKeys, err := validateAndCreateEncryptionKeys(cliCtx) if err != nil { @@ -161,6 +167,7 @@ func mainPut(cliCtx *cli.Context) (e error) { totalBytes += putURLs.SourceContent.Size pg.SetTotal(totalBytes) totalObjects++ + putURLs.DisableMultipart = disableMultipart putURLsCh <- putURLs } close(putURLsCh)