Browse Source

Merge pull request '修复云脑2下载中文名数据集丢失中文的问题' (#1855) from fix-1633 into V20220415

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/1855
Reviewed-by: ychao_1983 <ychao_1983@sina.com>
pull/1990/head
ychao_1983 3 years ago
parent
commit
470afaaaa5
1 changed files with 2 additions and 1 deletions
  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:] filename = key[comma+1:]
} }
reqParams := make(map[string]string) reqParams := make(map[string]string)
filename = url.QueryEscape(filename)
filename = url.PathEscape(filename)
reqParams["response-content-disposition"] = "attachment; filename=\"" + filename + "\"" reqParams["response-content-disposition"] = "attachment; filename=\"" + filename + "\""
input.QueryParams = reqParams input.QueryParams = reqParams
output, err := ObsCli.CreateSignedUrl(input) output, err := ObsCli.CreateSignedUrl(input)
@@ -503,6 +503,7 @@ func ObsGetPreSignedUrl(uuid, fileName string) (string, error) {
input.Bucket = setting.Bucket input.Bucket = setting.Bucket
input.Expires = 60 * 60 input.Expires = 60 * 60


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


Loading…
Cancel
Save