From e9f71ff23c24db455946186ff34973d3b9ed9485 Mon Sep 17 00:00:00 2001 From: namhq1989 Date: Thu, 12 Jan 2023 16:49:05 +0700 Subject: [PATCH] fix content type for video --- presigned_url.go | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/presigned_url.go b/presigned_url.go index 551f198..052adc6 100644 --- a/presigned_url.go +++ b/presigned_url.go @@ -3,8 +3,6 @@ package minio import ( "context" "fmt" - "net/url" - "strings" "time" ) @@ -15,20 +13,21 @@ func (c Client) GetPresignedURL(ctx context.Context, bucket, object, fileType st } // params - reqParams := make(url.Values) - //reqParams.Set("response-content-disposition", fmt.Sprintf("attachment; filename=\"%s\"", object)) - - // add content type for video - if fileType == ListTypes.Video { - parts := strings.Split(object, ".") - reqParams.Set("response-content-type", fmt.Sprintf("video/%s", parts[len(parts)-1])) - } + //reqParams := make(url.Values) + // + //// add content type for video + //if fileType == ListTypes.Video { + // parts := strings.Split(object, ".") + // reqParams.Set("response-content-type", fmt.Sprintf("video/%s", parts[len(parts)-1])) + //} else { + // reqParams.Set("response-content-disposition", fmt.Sprintf("attachment; filename=\"%s\"", object)) + //} // get - presignedURL, err := c.client.PresignedGetObject(ctx, bucket, object, expiry, reqParams) + presignedURL, err := c.client.PresignedGetObject(ctx, bucket, object, expiry, nil) if err != nil { 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 "" }