#1855 修复云脑2下载中文名数据集丢失中文的问题

Merged
ychao_1983 merged 1 commits from fix-1633 into V20220415 2 years ago
  1. +2
    -1
      modules/storage/obs.go

+ 2
- 1
modules/storage/obs.go View File

@@ -480,7 +480,7 @@ func GetObsCreateSignedUrlByBucketAndKey(bucket, key string) (string, error) {
filename = key[comma+1:]
}
reqParams := make(map[string]string)
filename = url.QueryEscape(filename)
filename = url.PathEscape(filename)
reqParams["response-content-disposition"] = "attachment; filename=\"" + filename + "\""
input.QueryParams = reqParams
output, err := ObsCli.CreateSignedUrl(input)
@@ -503,6 +503,7 @@ func ObsGetPreSignedUrl(uuid, fileName string) (string, error) {
input.Bucket = setting.Bucket
input.Expires = 60 * 60

fileName = url.PathEscape(fileName)
reqParams := make(map[string]string)
reqParams["response-content-disposition"] = "attachment; filename=\"" + fileName + "\""
input.QueryParams = reqParams


Loading…
Cancel
Save