Skip to content

Commit bfdf98f

Browse files
committed
fix(upload): 修复FsPreup函数中的文件存在检查逻辑
1 parent 7ccabf4 commit bfdf98f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/handles/fsup.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ func FsPreup(c *gin.Context) {
251251
storage := c.Request.Context().Value(conf.StorageKey).(driver.Driver)
252252
path := c.Request.Context().Value(conf.PathKey).(string)
253253
if !req.Overwrite {
254-
if res, _ := fs.Get(c.Request.Context(), path, &fs.GetArgs{NoLog: true}); res != nil {
254+
fullPath := utils.FixAndCleanPath(stdpath.Join(path, req.Name))
255+
if res, _ := fs.Get(c.Request.Context(), fullPath, &fs.GetArgs{NoLog: true}); res != nil {
255256
common.ErrorStrResp(c, "file exists", 403)
256257
return
257258
}

0 commit comments

Comments
 (0)