add encoded filename as part of upload url (#3140)

This commit is contained in:
Prakash Senthil Vel
2023-12-07 03:44:25 +05:30
committed by GitHub
parent 83b060ef94
commit 607d94fef4
3 changed files with 37 additions and 27 deletions

View File

@@ -24,7 +24,6 @@ import (
"io"
"net/http"
"net/url"
"path"
"path/filepath"
"regexp"
"strconv"
@@ -1030,8 +1029,8 @@ func uploadFiles(ctx context.Context, client MinioClient, params objectApi.PostB
if contentType == "" {
contentType = mimedb.TypeByExtension(filepath.Ext(p.FileName()))
}
_, err = client.putObject(ctx, params.BucketName, path.Join(prefix, path.Clean(p.FileName())), p, size, minio.PutObjectOptions{
objectName := prefix // prefix will have complete object path e.g: /test-prefix/test-object.txt
_, err = client.putObject(ctx, params.BucketName, objectName, p, size, minio.PutObjectOptions{
ContentType: contentType,
DisableMultipart: true, // Do not upload as multipart stream for console uploader.
})