put: Add --disable-multipart to make it easier to use. (#5041)

This commit is contained in:
llchry
2024-09-24 10:47:33 -07:00
committed by GitHub
parent be874766a7
commit a5a54b4429
+7
View File
@@ -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)