|
|
|
@@ -454,30 +454,7 @@ func ObsGenMultiPartSignedUrl(uuid string, uploadId string, partNumber int, file |
|
|
|
return output.SignedUrl, nil |
|
|
|
} |
|
|
|
|
|
|
|
func GetObsCreateSignedUrlByBucketAndKey(bucket, key string) (string, error) { |
|
|
|
input := &obs.CreateSignedUrlInput{} |
|
|
|
input.Bucket = bucket |
|
|
|
input.Key = key |
|
|
|
|
|
|
|
input.Expires = 60 * 60 |
|
|
|
input.Method = obs.HttpMethodGet |
|
|
|
comma := strings.LastIndex(key, "/") |
|
|
|
filename := key |
|
|
|
if comma != -1 { |
|
|
|
filename = key[comma+1:] |
|
|
|
} |
|
|
|
reqParams := make(map[string]string) |
|
|
|
filename = url.QueryEscape(filename) |
|
|
|
reqParams["response-content-disposition"] = "attachment; filename=\"" + filename + "\"" |
|
|
|
input.QueryParams = reqParams |
|
|
|
output, err := ObsCli.CreateSignedUrl(input) |
|
|
|
if err != nil { |
|
|
|
log.Error("CreateSignedUrl failed:", err.Error()) |
|
|
|
return "", err |
|
|
|
} |
|
|
|
log.Info("SignedUrl:%s", output.SignedUrl) |
|
|
|
return output.SignedUrl, nil |
|
|
|
} |
|
|
|
|
|
|
|
func GetObsCreateSignedUrlByBucketAndKey(bucket, key string) (string, error) { |
|
|
|
input := &obs.CreateSignedUrlInput{} |
|
|
|
@@ -501,7 +478,8 @@ func GetObsCreateSignedUrlByBucketAndKey(bucket, key string) (string, error) { |
|
|
|
return "", err |
|
|
|
} |
|
|
|
|
|
|
|
return output.SignedUrl, nil} |
|
|
|
return output.SignedUrl, nil |
|
|
|
} |
|
|
|
|
|
|
|
func GetObsCreateSignedUrl(jobName, parentDir, fileName string) (string, error) { |
|
|
|
// input := &obs.CreateSignedUrlInput{} |
|
|
|
|