Compare commits

..

No commits in common. "master" and "v0.0.4" have entirely different histories.

2 changed files with 6 additions and 9 deletions

View File

@ -3,10 +3,8 @@ package minio
var region = "ap-southeast-1" var region = "ap-southeast-1"
var Buckets = struct { var Buckets = struct {
Chat string
HelpCenter string HelpCenter string
}{ }{
Chat: "private-chat",
HelpCenter: "help-center", HelpCenter: "help-center",
} }
@ -15,11 +13,7 @@ var listBuckets = []string{
} }
var ListTypes = struct { var ListTypes = struct {
File string
Photo string
Video string Video string
}{ }{
File: "file",
Photo: "photo",
Video: "video", Video: "video",
} }

View File

@ -4,6 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"net/url" "net/url"
"strings"
"time" "time"
) )
@ -15,10 +16,12 @@ func (c Client) GetPresignedURL(ctx context.Context, bucket, object, fileType st
// params // params
reqParams := make(url.Values) reqParams := make(url.Values)
// set name for type "file"
if fileType == ListTypes.File {
reqParams.Set("response-content-disposition", fmt.Sprintf("attachment; filename=\"%s\"", object)) 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]))
} }
// get // get