|
|
@@ -4,6 +4,7 @@ import (
|
|
|
"context"
|
|
|
"dashoo.cn/opms_libary/multipart"
|
|
|
"fmt"
|
|
|
+ "github.com/gogf/gf/encoding/gurl"
|
|
|
"github.com/gogf/gf/text/gstr"
|
|
|
"github.com/gogf/gf/util/guid"
|
|
|
"io/ioutil"
|
|
|
@@ -472,7 +473,8 @@ func DownloadTempFile(url string) (*multipart.FileHeader, error) {
|
|
|
names := gstr.Split(r.Header.Get("Content-Disposition"), "filename=")
|
|
|
fileName := guid.S()
|
|
|
if len(names) > 1 {
|
|
|
- fileName = gstr.TrimStr(names[1], `"`)
|
|
|
+ fileName, _ = gurl.Decode(names[1])
|
|
|
+ fileName = gstr.TrimStr(fileName, `"`)
|
|
|
}
|
|
|
file, err := os.CreateTemp("", fileName)
|
|
|
if err != nil {
|