Compare commits
No commits in common. "master" and "v0.0.4" have entirely different histories.
|
@ -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",
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
reqParams.Set("response-content-disposition", fmt.Sprintf("attachment; filename=\"%s\"", object))
|
||||||
|
|
||||||
// set name for type "file"
|
// add content type for video
|
||||||
if fileType == ListTypes.File {
|
if fileType == ListTypes.Video {
|
||||||
reqParams.Set("response-content-disposition", fmt.Sprintf("attachment; filename=\"%s\"", object))
|
parts := strings.Split(object, ".")
|
||||||
|
reqParams.Set("response-content-type", fmt.Sprintf("video/%s", parts[len(parts)-1]))
|
||||||
}
|
}
|
||||||
|
|
||||||
// get
|
// get
|
||||||
|
|
Loading…
Reference in New Issue