Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Sep 30, 2023
2 parents 856445a + fee908d commit 67e0dad
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions kernel/model/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ func InsertLocalAssets(id string, assetPaths []string, isUpload bool) (succMap m
}

for _, p := range assetPaths {
fName := filepath.Base(p)
baseName := filepath.Base(p)
fName := baseName
fName = util.FilterUploadFileName(fName)
ext := filepath.Ext(fName)
fName = strings.TrimSuffix(fName, ext)
ext = strings.ToLower(ext)
fName += ext
baseName := fName
if gulu.File.IsDir(p) || !isUpload {
if !strings.HasPrefix(p, "\\\\") {
p = "file://" + p
Expand Down Expand Up @@ -148,13 +148,14 @@ func Upload(c *gin.Context) {
succMap := map[string]interface{}{}
files := form.File["file[]"]
for _, file := range files {
fName := file.Filename
baseName := file.Filename

fName := baseName
fName = util.FilterUploadFileName(fName)
ext := filepath.Ext(fName)
fName = strings.TrimSuffix(fName, ext)
ext = strings.ToLower(ext)
fName += ext
baseName := fName
f, openErr := file.Open()
if nil != openErr {
errFiles = append(errFiles, fName)
Expand Down

0 comments on commit 67e0dad

Please sign in to comment.