add get presigned url logs

This commit is contained in:
namhq1989 2023-01-08 18:59:27 +07:00
parent 1b6405dc25
commit 220aeed588
1 changed files with 4 additions and 6 deletions

View File

@ -3,7 +3,6 @@ package minio
import ( import (
"context" "context"
"fmt" "fmt"
"net/url"
"time" "time"
) )
@ -14,15 +13,14 @@ func (c Client) GetPresignedURL(ctx context.Context, bucket, object string, expi
} }
// params // params
reqParams := make(url.Values) //reqParams := make(url.Values)
reqParams.Set("response-content-disposition", fmt.Sprintf("attachment; filename=\"%s\"", object)) //reqParams.Set("response-content-disposition", fmt.Sprintf("attachment; filename=\"%s\"", object))
// get // get
presignedURL, err := c.client.PresignedGetObject(context.Background(), bucket, object, expiry, reqParams) presignedURL, err := c.client.PresignedGetObject(context.Background(), bucket, object, expiry, nil)
fmt.Println("presignedURL", presignedURL)
if err != nil { if err != nil {
fmt.Printf("[minio.GetPresignedURL][%s] get object %s error: %s \n", bucket, object, err.Error()) fmt.Printf("[minio.GetPresignedURL][%s] get object %s error: %s \n", bucket, object, err.Error())
fmt.Printf("params %v \n", reqParams) //fmt.Printf("params %v \n", reqParams)
return "" return ""
} }