Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
|
e857841b95 | |
|
e5f266c54a | |
|
e9f71ff23c | |
|
a2b1b1263b | |
|
f8db798af6 |
|
@ -3,8 +3,10 @@ package minio
|
|||
var region = "ap-southeast-1"
|
||||
|
||||
var Buckets = struct {
|
||||
Chat string
|
||||
HelpCenter string
|
||||
}{
|
||||
Chat: "private-chat",
|
||||
HelpCenter: "help-center",
|
||||
}
|
||||
|
||||
|
@ -13,7 +15,11 @@ var listBuckets = []string{
|
|||
}
|
||||
|
||||
var ListTypes = struct {
|
||||
File string
|
||||
Photo string
|
||||
Video string
|
||||
}{
|
||||
File: "file",
|
||||
Photo: "photo",
|
||||
Video: "video",
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -16,12 +15,10 @@ 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, ".")[1]
|
||||
reqParams.Set("response-content-type", fmt.Sprintf("video/%s", parts[len(parts)-1]))
|
||||
// set name for type "file"
|
||||
if fileType == ListTypes.File {
|
||||
reqParams.Set("response-content-disposition", fmt.Sprintf("attachment; filename=\"%s\"", object))
|
||||
}
|
||||
|
||||
// get
|
||||
|
|
Loading…
Reference in New Issue