mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
feat: fix the upload file name contains space problem (#1527)
This commit is contained in:
@ -72,17 +72,17 @@ func GetUploadFileUrl(provider *Provider, fullFilePath string, hasTimestamp bool
|
|||||||
if provider.Type == "Azure Blob" {
|
if provider.Type == "Azure Blob" {
|
||||||
host = util.UrlJoin(host, provider.Bucket)
|
host = util.UrlJoin(host, provider.Bucket)
|
||||||
}
|
}
|
||||||
fileUrl := ""
|
|
||||||
if provider.Type == "Tencent Cloud COS" {
|
fileUrl := util.UrlJoin(host, escapePath(objectKey))
|
||||||
fileUrl = util.UrlJoin(host, objectKey)
|
|
||||||
} else {
|
|
||||||
fileUrl = util.UrlJoin(host, escapePath(objectKey))
|
|
||||||
}
|
|
||||||
|
|
||||||
if hasTimestamp {
|
if hasTimestamp {
|
||||||
fileUrl = fmt.Sprintf("%s?t=%s", fileUrl, util.GetCurrentUnixTime())
|
fileUrl = fmt.Sprintf("%s?t=%s", fileUrl, util.GetCurrentUnixTime())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if provider.Type == "Tencent Cloud COS" {
|
||||||
|
objectKey = escapePath(objectKey)
|
||||||
|
}
|
||||||
|
|
||||||
return fileUrl, objectKey
|
return fileUrl, objectKey
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user