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 Buckets = struct {
Chat string
HelpCenter string
}{
Chat: "private-chat",
HelpCenter: "help-center",
}
@ -15,11 +13,7 @@ var listBuckets = []string{
}
var ListTypes = struct {
File string
Photo string
Video string
}{
File: "file",
Photo: "photo",
Video: "video",
}

View File

@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net/url"
"strings"
"time"
)
@ -15,10 +16,12 @@ func (c Client) GetPresignedURL(ctx context.Context, bucket, object, fileType st
// params
reqParams := make(url.Values)
// set name for type "file"
if fileType == ListTypes.File {
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